How do I move an array element with a known key to the end of an array in PHP?

The only way I can think to do this is to remove it then add it:

$v = $my_array['monkey'];
unset($my_array['monkey']);
$my_array['monkey'] = $v;

Leave a Comment