批改状态:合格
老师批语:
<?php$arr = [ 4 => 10, 1 => 22, 9 => 55, 0=>255];$res = array_values($arr);printf('<pre>%s</pre>',print_r($res,true));
<?php$arr1 = [ 4 => 10, 1 => 22, 9 => 55, 0=>255];$res1 = [];foreach($arr1 as $k => $v){array_push($res1,$v);}echo '<pre>';print_r($res1);
<?php$arr2 = [ 4 => 10, 1 => 22, 9 => 55, 0=>255];$res2[] = array_shift($arr2);$res2[] .= array_shift($arr2,);$res2[] .= array_shift($arr2,);$res2[] .= array_shift($arr2,);echo '<pre>';print_r($res2);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号