how to rearrange array in php code example
Example 1: rearrange array index php
$array = array_values($input);
Example 2: php rearrange array
function rearrange_array($array, $key) {
while ($key > 0) {
$temp = array_shift($array);
$array[] = $temp;
$key--;
}
return $array;
}