Home > Article > Backend Development > Example of string comparison function strcmp() in php
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!