Someone might find this function usefull. It just takes a given element from the array and moves it before given element into the same array.
<?php
function array_move($which, $where, $array)
{
$tmp = array_splice($array, $which, 1);
array_splice($array, $where, 0, $tmp);
return $array;
}
?>