【函数功能】
该函数比较两个字符串大小,不区分大小写。
	【函数语法】
strcasecmp ($str1, $str2)
	【参数说明】
$str1:必需,要比较的第一个字符串。
$str2:必需,要比较的第二个字符串。
	【演示程序】
<?php
  /**
   * strcasecmp ($str1, $str2)
   * **/
   $str1 = "hello";
   $str2 = "HELLO";
   echo strcasecmp($str1, $str2);
   echo "<br>";
   $str1 = "hello how are you?";
   $str2 = "HELLO are you ok?";
   echo strcasecmp($str1, $str2);
   echo "<br>";
   $str1 = "你好吗?";
   $str2 = "你好!";
   echo strcasecmp($str1, $str2);
?>
	【输出结果】
0
7
-10
	【特别注意】
1.该函数不区分大小写。
2.该函数是二进制安全的。
3.关于返回值:
=0 :两个字符串相等
<0 :$str1 小于 $str2
>0 :$str1 大于 $str2
4.如果两个字符串类似于:$str1="a",$str2="abc",则返回值为长度差,即-2。
5.PHP 版本:4+
	【原版定义】
/**
 * Binary safe case-insensitive string comparison of the first n characters
 *二进制安全,大小写不区分
 * @link http://www.php.net/manual/en/function.strncasecmp.php
 * @param str1 string <p>
 * The first string.
 * </p>
 * @param str2 string <p>
 * The second string.
 * </p>
 * @param len int <p>
 * The length of strings to be used in the comparison.
 *字符串长度也会用于比较
 * </p>
 * @return int < 0 if str1 is less than
 * str2; > 0 if str1 is
 * greater than str2, and 0 if they are equal.
 */
转载请注明出处:php1234.cn ,原文地址:http://www.php1234.cn/a/functions/2016/0918/59.html