Move array to bottom or to top

function moveArrayKeyToTop(&$array, $key) {
    $temp = array($key => $array[$key]);
    unset($array[$key]);
    $array = $temp + $array;
}
function moveArrayKeyToBottom(&$array, $key) {
    $value = $array[$key];
    unset($array[$key]);
    $array[$key] = $value;
}
Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp