Description of several character processing functions in php. String segmentation and connection functions: Code: arrayexplode (stringdelimiter, stringdata) uses the string dellimiter to split data into an array and returns a function similar to the split () code string segmentation and connection functions:
Code:
Array explode (string delimiter, string data)
Use the string dellimiter to split data into an array and return
Similar functions: split ()
Code:
String implode (array data, string dellimiter)
In contrast to explode (), the array is connected to a long string using dellimiter.
Function alias: join ()
Code:
Array split (string pattern, string text [, integer limit])
Use the character in pattern matching as the separator to split the string text into arrays.
Optional limit parameter, which limits the number of segments
String codec functions:
Code:
String addslashes (string text)
Before the special characters in the string text, add "" to return. Special characters include (),("),().
Similar functions: quotemeta ()
Code:
String stripslashes (string text)
This is the opposite of the addslashes () function. remove the backslash code.
Code:
String quotemeta (string text)
Similar to addslashes (), the difference is that its special characters include:. + *? [] ^ () $
Code:
String escapeshellcmd (string command)
Add a backslash before all characters that may cause trouble in shell commands.
Used before exec (), system (), and other functions.
Code:
String mysql_escape_string (string text)
Escape an SQL string for secure use in mysql_query ()
HTML functions
Code:
String htmlentities (string text)
Convert all HTML entities
Code:
String htmlspecialchars (string [, int quote_style [, string charset])
Convert a specific character to an HTML entity
Quote_style: (ENT_COMPAT | ENT_QUOTES)
Quote_style default value: ENT_COMPAT conversion & <>
When quote_style is: ENT_QUOTES, "and
Code:
String trim (string text)
Removes the null characters at the beginning and end of the text string.
Code:
String ltrim (string text)
Removes the null character at the beginning of the string text.
Code:
String rtrim (string text)
Removes the null character at the end of the text string.
Code:
String chop (string text)
Alias of the rtrim () function
Delimiter code: array explode (string delimiter, string data) uses the string dellimiter to split data into an array and return a function similar to the following: split () code...