PHP is often used to process string characters. php's built-in character functions provide very powerful functions that can basically complete most character processing operations, for example, use the str_split function to convert a character into an array, the implode function converts an array into one character, the strpos function searches for another character in one character, and the substr function obtains a certain number of characters in the character. the strlen function obtains the character length. These are the most basic knowledge of PHP, which is easy to use in daily work. I have summarized this function for your reference only.
1. How to convert a character into an array
Solution:Str_split ()Function
Example:
$ Biuuu = 'www .biuuu.com ';
Print_r (Str_split($ Biuuu ))
Output result:
Array
(
[0] => B
[1] => I
[2] => U
[3] => U
[4] => U
)
2. How to convert an array into a character
Solution:Implode() Function
Example:
$ Biuuu = array ('B', 'I', 'U ');
Print_r (Implode('', $ Biuuu ));
Output result
Biiuu
3. How to find another character in one character
Solution:StrposOr strstr
Example:
$ Biuuu = 'This is my website biuuu.com ';
$ Search = 'biuuu ';
Print_r (Strpos($ Biuuu, $ search ));
Output result:
19
4. How to obtain a certain number of characters
Solution:Substr() Function
Example:
$ Biuuu = 'This is my website biuuu.com ';
Print_r (Substr($ Biuuu, 19 ));
Output result:
Biuuu.com
5. How to get the character Length
Solution:Strlen() Function
Example:
$ Biuuu = 'This is my website biuuu.com ';
Print_r (Strlen($ Biuuu ));
Output result
28