这看起来很基本..。
我在第2行中定义了一个关联数组。
我在第6行调用asort() (大小写不敏感)
我的结果在第8行,这是错误的。
我期望/想要的是在第10行。
也许我该好好睡一觉?
<?php
$a1 = array( 1 => 'Brad', 2 => 'Chas', 3 => 'adam');
print_r($a1);
// prints "Array ( [1] => Brad [2] => Chas [3] => adam )"
echo "<br >\n";
asort($a1, SORT_FLAG_CASE || SORT_NATURAL);
print_r($a1); //
// prints "Array ( [3] => adam [2] => Chas [1] => Brad )" - wrong
// what I expect/want is
// "Array ( [3] => adam [1] => Brad [2] => Chas )"
?>发布于 2015-01-02 01:30:45
请将||替换为|
asort($a1, SORT_FLAG_CASE || SORT_NATURAL);我希望这能帮上忙
https://stackoverflow.com/questions/27736372
复制相似问题