Remove a dimension of an array
Posted: Sun Sep 13, 2009 7:27 pm
Is it possible without looping through the array to remove a every element with a certain key in one of the dimensions? Say you have an array 3x5 in size:
$array[0-2, 0-4]
and you have values in all those positions. Does anybody know how to remove all the array values that have a "3" key in the second position without looping through them? In other words...unset the following:
$array[0,3]
$array[1,3]
$array[2,3]
$array[0-2, 0-4]
and you have values in all those positions. Does anybody know how to remove all the array values that have a "3" key in the second position without looping through them? In other words...unset the following:
$array[0,3]
$array[1,3]
$array[2,3]