php array reorder index code example
Example: php rearrange array
function rearrange_array($array, $key) {
while ($key > 0) {
$temp = array_shift($array);
$array[] = $temp;
$key--;
}
return $array;
}
function rearrange_array($array, $key) {
while ($key > 0) {
$temp = array_shift($array);
$array[] = $temp;
$key--;
}
return $array;
}