function views_array_key_plus
Same name in other branches
- 7.x-3.x views.module \views_array_key_plus()
Adds one to each key of the array.
For example array(0 => 'foo') would be array(1 => 'foo').
1 call to views_array_key_plus()
File
-
./
views.module, line 1790
Code
function views_array_key_plus($array) {
$keys = array_keys($array);
rsort($keys);
foreach ($keys as $key) {
$array[$key + 1] = $array[$key];
unset($array[$key]);
}
asort($array);
return $array;
}