Compare two strings using a "natural" algorithm (case-insensitive): in PHP
Description
The following code shows how to compare two strings using a "natural" algorithm (case-insensitive):.
Example
//from w w w . j a v a 2 s. c o m
<?php
echo strnatcasecmp("2Hello world!","10Hello WORLD!");
echo "<br>";
echo strnatcasecmp("10Hello world!","2Hello WORLD!");
?>
The code above generates the following result.