|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-07 04:46 UTC] rgaidot at swt dot fr
I have tried to use the sort function on a string array. The array strings include both integer and char characters.
(e.g. 0000AER, 000000S0, 00000073)
I have noted that the result differs between the two systems Windows and Unix. Indeed the result on Unix is correct, but it is not correct on Windows.
I have made a C++ test application in order to compare the results between the two systems and I did not note any problem.
<PHPScript_Test>
$a=array(
array('000000S0','1','5'),
array('000000O2','2','4'),
array('000000D2','3','3'),
array('000000MH','4','2'),
array('00000073','5','1')
);
echo "<h1>Data</h1>";
echo "<pre>";
var_dump($a);
echo "</pre>";
sort($a);
echo "<h1>Result</h1>";
echo "<pre>";
var_dump($a);
echo "</pre>";
</PHPScript_Test>
Thanks,
R?gis Gaidot
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
Reduced to: <?php print_r(array('0D2', '004')); ?> Further details soon...Ok, almost :) <?php print_r(sort(array('0D2', '004'))); ?>