PHP strcasecmp() 函数
比较两个字符串(不区分大小写):
<?php
echo strcasecmp("Hello world!","HELLO WORLD!");
?>
echo strcasecmp("Hello world!","HELLO WORLD!");
?>
定义和用法
strcasecmp() 函数比较两个字符串。
提示:strcasecmp() 函数是二进制安全的,且不区分大小写。
提示:该函数与
实例 2
不同的返回值:
<?php
echo strcasecmp("Hello world!","HELLO WORLD!"); // The two strings are equal
echo strcasecmp("Hello world!","HELLO"); // String1 is greater than string2
echo strcasecmp("Hello world!","HELLO WORLD! HELLO!"); // String1 is less than string2
?>
echo strcasecmp("Hello world!","HELLO WORLD!"); // The two strings are equal
echo strcasecmp("Hello world!","HELLO"); // String1 is greater than string2
echo strcasecmp("Hello world!","HELLO WORLD! HELLO!"); // String1 is less than string2
?>
版权声明:本页面内容旨在传播知识,为用户自行发布,若有侵权等问题请及时与本网联系,我们将第一时间处理。E-mail:284563525@qq.com