Home  >  Article  >  Backend Development  >  PHP function strcmp function example tutorial_PHP tutorial

PHP function strcmp function example tutorial_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:00:321138browse

Definition and usage
The strcmp() function compares two strings.

This function returns:

0 - if the two strings are equal
"0 - if string is less than string
"0 - if string is greater than string
Grammar

strcmp(string1,string2)

		Parameter
Description
string1 必需的。指定的第一个字串比较
string2 必需的。指定第二个字符串比较
Description
string1 Required. Compares the first specified string
string2 Required. Specify a second string comparison


Tips and Instructions NOTE: The strcmp() function is binary safe and case sensitive. For example

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445525.htmlTechArticleDefinition and Usage The strcmp () function compares two strings. This function returns: 0 - if the two strings are equal 0 - if the string is less than the string 0 - if the string is greater than the character...
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