1 string Case function Strtoupper ($STR) strtolower ($STR)2String cut function Explode (',', $STR) Join (',', $str) Implode (',', $str)3 string length function strlen ($STR)4String repetition function str_repeat ($STR,2)5 string First character uppercase Ucfirst ($STR)6 string Word first character uppercase ucwords ($STR)7Removes both sides of the specified character trim ($STR,',.?!') LTrim ($STR,',.?!') RTrim ($STR,',.?!')8Finds the position of the specified string in the original string Strpos ($str,'a', $offset), the first position that appears after offset; Stripos ignores case and Stripos as Strrpos ($STR,'a',0); Strripos ($str, $find, $start)9Searches for the position of a string in another string Strstr ($str,'b') = Bcdefgs ... strchr and strstr @[email protected]163. com STRRCHR is a substring that finds the first occurrence on the right163. comTenFind substrings substr substr ($str, $start, $length); If $start <0, starting with the inverse of the string abs ($start), if $length <0, it is intercepted, generally not One fills the string Str_pad ($STR, the target length, the filled string, the fill rule); Str_pad_left left padding, str_pad_right and padding, str_pad_both both sides filled ACompares string strcmp ($a, $b) if $ A is greater than $b, returns 1 if $ A is less than $b, returns-1equals is returned 0 -Replace String Str_replace ('Original String','New String', $STR); - scrambled A string str_shuffle ($STR) theCut string Str_split ($str, $sub _length) =cut string to get an array, followed by cut length - removal of HTML and PHP markup Strip_tags ($STR, $allow _tags); Removal of $allow_tags except in Str - inverse literal string stripslashes ($STR); - Escape string addslashes ($STR); +Comparing string strnatcmp ($a, $b) using natural sorting algorithms101> OneSo get 1,strcmp ('101',' One'Get1 -Invert string Strrev ($str) + = Get inverse string
String functions commonly used in PHP str