SUBSTR (str,start,length);
Example: substr (' PHP tutorial is very good language ', 4,5);
The output is the is ve;
When the length of the START>STR, it is returned as ();
substr (' PHP is very good language ', 26,5);
substr (' PHP is very good language ', 4);
Output as (blank)
Output is V (indicates start and langth are 4)
When start is negative, start reading from the end of STR (* This is read from 1 instead of starting at 0).
substr (' PHP is very good language ', -4,5);
Output is Uage
When length is a negative value, length represents the end of the read from the end and intercepts the ending position of str.
substr (' PHP is very good language ', 4,-5);
Output is very good LAN
Explode () splits the function string 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 () output string from back to forward
Echo Strrev ("June"); Outputs "Enuj"
Setlocalhost (content location) sets the local environment. Content, which specifies the scene information constants that need to be set (
lc_all– Constants for all subordinates
lc_collate– Sorting order
lc_ctype– character classification and conversion (for example, converting all characters to lowercase or uppercase)
lc_messages– System Information Format
lc_monetary– Currencies/Currency formats
lc_numeric– Numeric format
lc_time– Date and time formats
Location, set up a national region, for example, chs.
http://www.bkjia.com/PHPjc/445364.html www.bkjia.com true http://www.bkjia.com/PHPjc/445364.html techarticle substr (str,start,length); Example: substr (PHP tutorial is very good language,4,5); output as is ve; when startstr length, return as (); substr (PHP is ver Y good language,26,5); S ...