Home > php教程 > php手册 > body text

php函数 strcmp函数实例教程

WBOY
Release: 2016-06-13 11:16:49
Original
1646 people have browsed it

 

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

这个函数返回:

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

strcmp(string1,string2)
Copy after login
Copy after login
Copy after login
		Parameter
Copy after login
Description
string1 必需的。指定的第一个字串比较
string2 必需的。指定第二个字符串比较
Copy after login
Copy after login

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

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

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!