...압축 PHP를 배열
array(11 => "fistVal", 19 => "secondVal", 120=> "thirdVal", 200 =>"fourthVal");
과로 변환 ...
array(0 => "fistVal", 1 => "secondVal", 2=> "thirdVal", 3 =>"fourthVal");
이 내가 생각 해낸 것입니다 -
function compressArray($array){
if(count($array){
$counter = 0;
$compressedArray = array();
foreach($array as $cur){
$compressedArray[$count] = $cur;
$count++;
}
return $compressedArray;
} else {
return false;
}
}
php 나 내장 트릭에 내장 기능이 있는지 궁금합니다.
중복 : http://stackoverflow.com/questions/1111761/what-is-the-built-in-php-function-for-compressing-or-defragmenting-an-array –