note 101073 added to function.natsort
| From: | (phpatgenjodotfr) | Date: | Wed, 24 Nov 2010 15:18:46 +0000 |
| Subject: | note 101073 added to function.natsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174324@lists.php.net to get a copy of this message | ||
Be careful of the new behaviour in 5.2.10 version.
See the following sample:
<?php
$array = array('1 bis', '10 ter', '0 PHP', '0',
'01', '01 Ver', '0 ', '1 ', '1');
natsort($array);
echo '<pre>';
print_r($array);
echo '</pre>';
?>
5.2.6-1 will output:
Array
(
[3] => 0
[6] => 0
[2] => 0 OP
[4] => 01
[5] => 01 Ver
[8] => 1
[7] => 1
[0] => 1 bis
[1] => 10 ter
)
5.2.10 will output:
Array
(
[6] => 0
[3] => 0
[8] => 1
[4] => 01
[7] => 1
[5] => 01 Ver
[0] => 1 bis
[1] => 10 ter
[2] => 0 OP
)
Greetings
----
Server IP: 89.31.146.176
Probable Submitter: 82.235.19.195
----
Manual Page -- http://www.php.net/manual/en/function.natsort.php
Edit -- https://master.php.net/note/edit/101073
Del: integrated -- https://master.php.net/note/delete/101073/integrated
Del: useless -- https://master.php.net/note/delete/101073/useless
Del: bad code -- https://master.php.net/note/delete/101073/bad+code
Del: spam -- https://master.php.net/note/delete/101073/spam
Del: non-english -- https://master.php.net/note/delete/101073/non-english
Del: in docs -- https://master.php.net/note/delete/101073/in+docs
Del: other reasons-- https://master.php.net/note/delete/101073
Reject -- https://master.php.net/note/reject/101073
Search -- https://master.php.net/manage/user-notes.php