You are here : phpstringstrcmp

strcmp() - string


Parameters :
  • str1 - The first string.
  • str2 - The second string.

  • Syntax

    int strcmp
        ( string $str1
       , string $str2
       )


    Example

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


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference