Name

strcasecmp()

Synopsis

    int strcasecmp ( string str1, string str2 )

This is a case-insensitive version of the strcmp() .

    $result = strcasecmp("Hello", "hello");

That will return 0, because PHP will ignore the case difference. Using strcmp() instead would have returned -1: "Hello" would come before "hello".

Get PHP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.