The strtok () function only reads out a substring based on the delimiter. The delimiter can be a character or a string.
Normalize characters with% character format output control characters in character formatted output String case strtoupper (): string uppercase strtolower (): lowercase string ucfirst (): Capitalize the first letter ucwords (): capitalize the first character of each paragraph of English String concatenation and splitting explode (): return to an array according to the specified character as the split condition array explode(string separator, string input ) strtok (): string strtok(string input, string separator) Character formatted output: sprintf () / printf () int pritnt(string format ) // 输出结果字符串string sprintf(string format ) // 返回结果字符串 The nl2br () function takes a string as input and replaces the \ n symbol with a tag in HTML this is useful for displaying a long string on an HTML browser. The htmlspecialchars () function will output a string as an HTML entity (can translate characters with special meaning in the string into HTML entities) str_replace (): regular filter output nl2br (): HTML formatting Similar to rtrim () function Formatted output: htmlspecialchars (): function to filter output Remove special characters starting at the end of the string chop (): Remove special characters from the beginning of the string ltrim (): Remove the characters at the beginning and end of the string (carriage return, line feed, tab) and return the result stringĪt the same time, the trim () parameter can also set a custom special character filtering list rtrim ():
PHP String String formatting String truncation: trim ():