Home  >  Article  >  php教程  >  php函数 strcmp函数实例教程

php函数 strcmp函数实例教程

WBOY
WBOYOriginal
2016-06-13 11:16:491648browse

 

定义和用法
该strcmp ( )函数比较两个字符串。

这个函数返回:

0 -如果这两个字符串相等
“ 0 -如果字符串小于字符串
“ 0 -如果字符串大于字符串
语法

strcmp(string1,string2)

		Parameter
Description
string1 必需的。指定的第一个字串比较
string2 必需的。指定第二个字符串比较


提示和说明 注: strcmp ( )函数是二进制安全和区分大小写。 例如

<!--?phpecho strcmp("Hello world!","Hello world!");?-->
结果:0

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn