List of PHP binary safe functions: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 3: Line 3:
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! Goal !! Binary safe function !! '''NOT''' binary safe
! Purpose !! Binary safe function !! '''NOT''' binary safe
|-
|-
| "Return part of a string" || [https://www.php.net/manual/en/function.mb-substr.php mb_substr] || [https://www.php.net/manual/en/function.substr.php substr]
| "Return part of a string" || [https://www.php.net/manual/en/function.mb-substr.php mb_substr] || [https://www.php.net/manual/en/function.substr.php substr]

Revision as of 14:07, 11 July 2019

List of PHP binary safe[1] functions. Briefly speaking, using binary safe functions to manipulating the string in Madarian or other unicode string.

Purpose Binary safe function NOT binary safe
"Return part of a string" mb_substr substr
"Get string length" mb_strlen strlen
"Count the number of substring occurrences" mb_substr_count substr_count
"Replace all occurrences of the search string with the replacement string" str_replace
"Find the position of the first occurrence of a substring in a string" strpos
"Replace text within a portion of a string" substr_replace
... ... ...


references