Strripos ($str, Search,[int]):Ditto, this function is insensitive to case
2. Extract substring function (double byte)
SUBSTR ($str, int start[,int length]): Extracts [length string] from strat position in $str.
Strstr ($str 1, $str 2): Searches the $str2 from the $STR1 (the first position) and intercepts it to the ending string, or false if not.
The STRISTR () feature is the same as STRSTR, but is case-insensitive.
STRRCHR () return from the last search to the word entered prompt; use: take the filename in the path
3, the substitution string PHP string function
Str_replace (Search,replace, $STR): Search from $STR Replace with replace
Str_ireplace (Search,replace, $str): Ibid., this function is insensitive to case
STRTR ($str, search,replace): Replace cannot be "" in this function;
Substr_replace ($Str, $rep, $start [, Length]): $str The original string, $rep the replacement of the new string, $start the start, $length the length of the replacement, the optional
4, character length
int strlen ($STR)
5. Comparing character functions
int strcmp ($str 1, $str 2): $str 1>=< $str 2 is positive 1,0,-1 (string comparison)
STRCASECMP () ditto (case-insensitive)
STRNATCMP ("4", "14") compare strings by natural sort
STRNATCASECMP () ditto, (case-sensitive)
6, split the array of PHP string functions
Str_split ($str, Len): Dividing the $str by Len length to return an array
Split (search, $str [, int]): Divide $str by search character return array int is split several times, the following will not split expload (Search, $str [, int])
7, remove the space:
LTrim (), RTrim (), Trim ()
8, add space function
Chunk_split ($STR, 2): Add a space to the $STR character by 2 characters;
9, CHR, ord--returns the specified character or ASCII
10, HTML code related functions
NL2BR (): Convert \ n to <br>.
Strip_tags ($str [, ' <p> ']): Removing HTML and PHP tags
All HTML and PHP code in $STR will be removed, and optional parameters for HTML and PHP code will be reserved for the optional parameters written in the code.
such as: Echo Strip_tags ($text, ' <br><p> ');
Htmlspecialchars ($str [, Parameters]): page normal output HTML code parameters, is the conversion mode
11, character case conversion of PHP string function
Strtolower ($STR): Converting strings to lowercase
Strtoupper ($STR): Converting strings to uppercase
Ucfirst ($STR): Converts the first character of a function to uppercase
Ucwords ($STR): Converts the first letter of each word to uppercase
12, database-related PHP string functions
addslashes ($STR): Converts single quotes ('), double quotes ("), backslashes (\) and NUL
strings in str to \, \, \ \。
MAGIC_QUOTES_GPC = On: Automatically escapes the contents of Get,post,cookie
GET_MAGIC_QUOTES_GPC (): Detects whether the MAGIC_QUOTES_GPC is turned on
stripslashes (): Remove backslash in string