(PHP 4, PHP 5, PHP 7)
strcasecmp — 锟斤拷锟斤拷锟狡帮拷全锟饺斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街达拷小写锟斤拷
$str1
, string $str2
) : int锟斤拷锟斤拷锟狡帮拷全锟饺斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街达拷小写锟斤拷锟斤拷
str1
锟斤拷一锟斤拷锟街凤拷锟斤拷锟斤拷
str2
锟节讹拷锟斤拷锟街凤拷锟斤拷锟斤拷
锟斤拷锟� str1
小锟斤拷
str2
锟斤拷锟斤拷 < 0锟斤拷
锟斤拷锟� str1
锟斤拷锟斤拷 str2
锟斤拷锟斤拷 > 0锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟饺o拷锟斤拷锟斤拷 0锟斤拷
Example #1 strcasecmp() 锟斤拷锟斤拷
<?php
$var1 = "Hello";
$var2 = "hello";
if (strcasecmp($var1, $var2) == 0) {
echo '$var1 is equal to $var2 in a case-insensitive string comparison';
}
?>