$arr1 = $arr2 = array( "img12.png" ,"img10.png" ,"img2.png" ,"img1.png"); echo "Standard string comparison\n"; usort($arr1 ,"strcmp"); print_r($arr1); echo "\nNatural order string comparison\n"; usort($arr2 ,"strnatcmp"); print_r($arr2);
?php $arr1 = $arr2 = array( "img12.png" ,"img10.png" ,"img2.png" ,"img1.png"); echo "Tri de cha icirc;nes standard\n"; usort($arr1 ,"strcmp"); print_r($arr1); echo "\nTri de cha icirc;nes \"ordre naturel\"\n"; usort($arr2 ,"strnatcmp"); print_r($arr2);?