Home  >  Article  >  Backend Development  >  Example of string comparison function strcmp() in php

Example of string comparison function strcmp() in php

黄舟
黄舟Original
2017-10-10 09:58:471537browse

int strcmp (string $str1, string $str2)

Compare in binary mode
Comparison with this function is case-sensitive
Return value, if str1 If it is less than str2, it returns cc4d5e344e7010ceeee94a4ed9c60bdb0. If they are equal, it returns 0.


There is also a function strcasecmp(), the usage is similar to strcmp(), except that it is not case-sensitive, so I won’t be verbose here

The above is the detailed content of Example of string comparison function strcmp() in php. For more information, please follow other related articles on the PHP Chinese website!

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