Intercepting strings
Mb_substr ($str, Star,count,encode);
Get string length
Mb_strlen ();
Carriage return wrap complete in textarea text
Str_replace (CHR), "<br/>", $textarea);
Return the corresponding letter based on ASCII
echo "ASCII is a 66 letter:". Chr (66). " <br> ";
Chop to remove contiguous spaces and whitespace in a string
$str = "he llo Wo Rd"; echo "s:";
echo "s:". Chop ($STR). W ";
Explode to return an array by a character-splitting string
$str = "Green,red,yellow,white";
$arr =explode ("", $str); the array after the echo is: ";
Print_r ($arr);
Implode the array into a string by a character
$arr =array ("A", "B", "C", "D");
$str =implode ('/', $arr);
echo "<br> string is:". $str;
Printing print
Print ("Printing method prints");
echo "Format print printf:<br>";
printf ("%f%", 2, "D");
Case-insensitive comparison strings
Echo is case-insensitive:. strcasecmp ("Hello word", "Hello word");
Case sensitive
echo "case-sensitive:". strcmp ("Hello word", "Hello word");
Find string
echo "The result of the lookup is:". STRCHR ("Hello word", "hello");
String length
echo "str length:". strlen ("Hello word");
Repeat the string several times Str_repeat
echo "repeats the string several times:". Str_repeat ("WS", 3);
Arrange strings in reverse order
echo "Zifuchuandaoxu:". Strrev ("Zifuchuandaoxu");
Capitalize the string and convert it to lowercase
Strtolower ();
Strtoupper ();
String substitution,
echo "The replaced string is:". Str_replace ("B", "*", "AAAAABBBBBCCCCC");
Cutting string
echo "After the cut string is:". substr ("Hello word", 2, 3);