The function of string manipulation in PHP3.0 is much more, and it is important to have the following:
(1) echo,print,printf,sprintf
Used for the output string. If there is a variable name in the string, it is replaced with its value. The latter two functions are similar to C's with the same name function.
(2) STRCHR, strlen, Strtok, STRRCHR, Strrev, Strstr, Strtolower, Strtoupper, substr, Ucfirst
String manipulation functions, some of which have exactly the same meaning as the function in C. Strrev is to flip a string. Strtolower and Strtoupper are converting strings to lowercase and uppercase. Ucfirst is to capitalize the first character of a string. Substr is a substring of the returned string, using: substr (String, header, length). The head position is calculated from 0. If it is negative, it is the meaning of the forward number from the tail.
(3) Chr,ord
function with the same name.
(4) Explode,implode,join
The function associated with the array. Explode (string, delimiter) returns an array that separates the strings from the delimiters. Implode (array, delimiter) returns a string that divides the elements of an array into delimiters. Joins have the same meaning as implode.
(5) Chop
Handles whitespace at the end of a string.
(6) Htmlspecialchars
Replace the HTML special characters with their names, such as "<" into "<".
(7) NL2BR
Each carriage return in HTML is preceded by a "
".
(8) Addslashes,stripslashes
Add "" and remove "to the string as needed, and for some databases, you must add and remove the characters you want to query before you can query.
(9) Parse_str
Parse a string of type "Name1=value1&name2=value2& ..." into some variable.
For example: Parse_str ("a=1&b=2"); Generate $ A and $b two variables, respectively. If there are two pairs of name/value names that are part of the same, then the next value overrides the previous one. If both pairs have "[]" tails, such as "a[]=1&a[]=2", an array of $ A is generated and two elements are each.
http://www.bkjia.com/PHPjc/445599.html www.bkjia.com true http://www.bkjia.com/PHPjc/445599.html techarticle The string manipulation function in PHP3.0 is much more, and it is important to have the following: (1) echo,print,printf,sprintf is used for output strings. If there is a variable name in the string, it is replaced with its value. After two ...