You are here : phpstringstrcasecmp

strcasecmp() - string

Binary safe case-insensitive string comparison.
Parameters :
  • str1 - The first string
  • str2 - The second string

  • Syntax

    int strcasecmp
        ( string $str1
       , string $str2
       )


    Example

    <?php$var1 = "Hello";$var2 = "hello";if (strcasecmp($var1, $var2) == 0) {    echo '$var1 is equal to $var2 in a case-insensitive string comparison';}?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference