Php Learning Path 3 (string operation) & lt ;? Php * String remove Space @ authorlixingle * stringtrim (string $ str [, string $ charlist); * ltrim (string $ str [, string $ charlist ); take out the space * rtrim (string $ str [, Path 3 for stri Php learning (string operation)
";?>
"; // Return-1 because the ASCII value of the lowercase letter is greater than the value of the upper-case grandmother echo strcasecmp (" abcD "," abcd ")."
"; // Return 0?>
"; Echo strstr ($ parent, $ needle )."
"; $ Text =" This is a test "; $ needle =" is "; echo strlen ($ text )."
"; Echo substr_count ($ text, $ needle )."
"; // The Returned result is 2 echo substr_count ($ text, $ needle, 3 )."
"; // Start from the fourth character. The returned result is 1 echo substr_count ($ text, $ needle, 3, 3 )."
"; // Start from the fourth character. The search length is 3. the returned result is 0/** Int strrpos (string $ haystack, mixed $ needle, int len); // you can find the last position, * $ needle if it is a string, only the first character * int strpos (string $ haystack, string $ needle, int len ); // find the first position ** string str_replace (string $ str1, string $ str2, string $ str3); * $ str1 is the string to be replaced. $ Str2 is a new string. $ str3 is the original string * string substr_replace (string $ str1, string $ str2, string $ str3, int n). * $ str1 is the string to be replaced. $ Str2 is a new string, $ str3 is the original string, and n is the replacement length. **/echo str_replace ("World", "PHP", "Hello World! ")."
"; // Output Hello PHP!?>
"; Echo" \ $ user = ". $ user ."
"; Echo" \ $ password = ". $ password ."
";?>