|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-23 10:20 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 06:00:01 2026 UTC |
Description: ------------ 在数字和字母混合的键值数组中 数字key被重新排列了 use array_slice array keys for number and string the result is err! Reproduce code: --------------- $thisArray=array(1=>0,2=>31,"a9"=>1,"0"=>3,"abc"=>20); print_r($thisArray); $a2=array_slice($thisArray,0,100); print_r($a2); Expected result: ---------------- Array ( [1] => 0 [2] => 31 [a9] => 1 [0] => 3 [abc] => 20 ) Array ( [1] => 0 [2] => 31 [a9] => 1 [0] => 3 [abc] => 20 ) Actual result: -------------- Array ( [1] => 0 [2] => 31 [a9] => 1 [0] => 3 [abc] => 20 ) Array ( [0] => 0 [1] => 31 [a9] => 1 [2] => 3 [abc] => 20 )