";
?>
";//返回-1因为小写字母的ASCII值大于大写祖母的值
echo strcasecmp("abcD","abcd")."
";//返回0
?>
";
echo strstr($parent,$needle)."
";
$text="This is a test";
$needle="is";
echo strlen($text)."
";
echo substr_count($text, $needle)."
";//返回结果为2
echo substr_count($text, $needle,3)."";//从第四个字符开始查找。返回结果为1 echo substr_count($text, $needle,3,3)."
";//从第四个字符开始查找。查找长度为3.返回结果为0 /* *Int strrpos(string $haystack,mixed $needle,int len); //查找最后一次的位置, * $needle如果是字符串只取第一个字符 * int strpos(string $haystack,string $needle,int len); //查找第一次的位置 * * string str_replace(string $str1,string $str2,string $str3); * $str1为要被替换的字符串。$str2为新字符串,$str3为原字符串 * string substr_replace(string $str1,string $str2,string $str3,int n); * $str1为要被替换的字符串。$str2为新字符串,$str3为原字符串,n为替换长度 * */ echo str_replace("World","PHP","Hello World!")."
";//输出Hello PHP! ?> "; echo "\$user=".$user."
"; echo "\$password=".$password."
"; ?>