常用字符串函数(一)_PHP
程序员文章站
2022-05-31 09:35:33
...
$first = "abc";
$second = "aBc";
if(strcmp($first, $second) == 0)//字串比较
{
print("字符串相等:"."
");
}
else
{
print("字符串不相等"."
");
}
?>
print("a short string ".strlen("a short string")."
");//字串长度
?>
$text = "hello world";
print(strpos($text, "w")."
");//寻找字串中某字元最先出现处
?>