note 38508 deleted from function.natsort by vincent
| From: | vincent@php.net | Date: | Wed, 24 Dec 2003 22:57:17 +0000 |
| Subject: | note 38508 deleted from function.natsort by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62435@lists.php.net to get a copy of this message | ||
Note Submitter: MagicalTux at FF.st
----
The natsort doesn't work well everytimes..
Example (php 4.3.4) :
<?
$arr=array();
$arr[]='1.jpg';
$arr[]='2.jpg';
$arr[]='3.jpg';
$arr[]='4.jpg';
$arr[]='5.jpg';
$arr[]='06.jpg';
$arr[]='07.jpg';
natsort($arr); // should not change order
var_dump($arr);
?>
result :
array(7) {
[5]=>
string(6) "06.jpg"
[6]=>
string(6) "07.jpg"
[0]=>
string(5) "1.jpg"
[1]=>
string(5) "2.jpg"
[2]=>
string(5) "3.jpg"
[3]=>
string(5) "4.jpg"
[4]=>
string(5) "5.jpg"
}