List of PHP binary safe functions: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
([https://gist.github.com/JBlond/942f17f629f22e810fe3 mb_substr_replace]) |
||
Line 17: | Line 17: | ||
| "Find the position of the first occurrence of a substring in a string" || [https://www.php.net/manual/en/function.mb-substr.php mb_substr] || [https://php.net/manual/en/function.strpos.php strpos] | | "Find the position of the first occurrence of a substring in a string" || [https://www.php.net/manual/en/function.mb-substr.php mb_substr] || [https://php.net/manual/en/function.strpos.php strpos] | ||
|- | |- | ||
| "Replace text within a portion of a string" || [https://www.php.net/manual/en/function.substr-replace.php substr_replace] || | | "Replace text within a portion of a string" || [https://www.php.net/manual/en/function.substr-replace.php substr_replace] or [https://gist.github.com/JBlond/942f17f629f22e810fe3 mb_substr_replace] || | ||
|- | |- | ||
| ... || ... || ... | | ... || ... || ... |
Revision as of 08:16, 4 October 2020
List of PHP binary safe[1] functions. Briefly speaking, using binary safe functions to manipulate 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 |
"Convert a string to an array | mb_str_split | str_split |
"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" | mb_substr | strpos |
"Replace text within a portion of a string" | substr_replace or mb_substr_replace | |
... | ... | ... |