There are 2 functions involved.
$array = a
I think the best solution I've found is :
if you just want to remove just one element :
array_splice($array,1,1); // all keys will be reindexed from 0
where the second and third parameters are offset (key) and length (how many to remove)
The best to remove multiple keys : use array_filter() to remove all empty strings and falsey value from the array then array_splice() to reorder :
array_splice(array_filter($array), 0, 0);
$array = array_values($array);