Source Code:
(back to article)
<?php $string1 = "file1.txt"; $string2 = "file10.txt"; $result = strnatcmp($string1, $string2); if ($result < 0) { echo "$string1 is less than $string2"; } elseif ($result > 0) { echo "$string1 is greater than $string2"; } else { echo "$string1 is equal to $string2"; }
Result:
Report an issue