Var_dump() of my array before array_filter():
array(2) { [0]=> string(0) "" [1]=> string(2) "46" }
Var_dump() of my array after array_filter():
array(1) { [1]=> string(2) "46" }
However I want to get array(1) { [0]=> string(2) "46" }, with the remaining element at the beginning of the array (0, not 1). How to do that?
messes up their location? No, actually it leaves the keys exactly as they were.... if you want to change that, then wrap your array_filter() call in an array_values() call