时间:2021-07-01 10:21:17 帮助过:12人阅读
$test=array('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6);
$one=array_slice($test, 0,2);
$two=array_diff_key($test, $one);
var_dump($one,$two);
------解决方案--------------------
$test = array('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6);
$ar[] = array_slice($test, 0, 2);
$ar[] = array_slice($test, 2);
print_r($ar);