Phpsubstr (), explode (), strrev (). Substr (str, start, length); example: substr (php Tutorial isverygoodlanguage,); output is isve; when startstr length, return (); substr (phpisverygoodlanguage, 26, 5); s substr (str, start, length );
Example: substr ('php tutorial is very good language );
Output is ve;
If the length of start> str is returned ();
Substr ('php is very good language );
Substr ('php is very good language ', 4 );
Output as (blank)
Output is v (both start and langth are 4)
When start is a negative value, it starts to read from the end of str (* at this time, it starts to read from-1 rather than from 0 ),
Substr ('php is very good language );
Output as uage
When the value of length is negative, length indicates reading from the end and intercepting the end position of str.
Substr ('php is very good language ', 4,-5 );
Output is very good lan
Explode () splits function strings into arrays;
// Example 1
$ Pizza = "piece1 piece2 piece3 piece4 piece5 piece6 ";
$ Pieces = explode ("", $ pizza );
Echo $ pieces [0]; // piece1
Echo $ pieces [1]; // piece2
// Example 2
$ Data = "foo: *: 1023: 1000:/home/foo:/bin/sh ";
List ($ user, $ pass, $ uid, $ gid, $ gecos, $ home, $ shell) = explode (":", $ data );
Echo $ gecos ."
"; // Foo
Echo $ shell ;//*
Strrev () outputs the string from the back to the front
Echo strrev ("June"); // outputs "enuj"
Setlocalhost (content location) sets the local environment. content, and specifies the scenario information constants to be set include (
Lc_all-constants of all subordinates
Lc_collate-sort order
Lc_ctype-character classification and conversion (for example, converting all characters into lowercase or upper case)
Lc_messages-system information format
Lc_monetary-currency/currency format
Lc_numeric-numeric format
Lc_time-date and time format
); Location, set the country region, for example, chs.
Http://www.bkjia.com/PHPjc/445364.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445364.htmlTechArticlesubstr (str, start, length); example: substr (php Tutorial is very good language,); output is ve; when startstr length, return is (); substr (php is very good language, 26, 5); s...