Pretty nice! The last time I had this issue, I did this, some shopping cart, apparently...
function compact_array($array) {
for ($y=count($array); $y>0; $y--) {
$x=($y-1);
if (((empty($array[$x]) || (!($array[$x])))) && ($array[$y])){
$array[$x]=$array['cart'][$y];
unset($array[$y]);
}
}
return $array;
}
Pretty Bass-ackwards, I guess ...