Source Code:
(back to article)
<?php $string1 = "abc"; $string2 = "abc"; $string3 = "def"; if (strcmp($string1, $string2) == 0) { echo 'strcmp($string1, $string2) == 0 is true' . PHP_EOL; // this will be true, since the strings are equal } if (strcmp($string1, $string3) < 0) { echo 'strcmp($string1, $string3) < 0 is true' . PHP_EOL; // this will be true, since "abc" comes before "def" alphabetically }
Result:
Report an issue