I am trying to delete an array object based on some criteria found within it's data.
For example, I'd like to delete any "sub" array within the larger array which has no value at the [0] key.
Using the sample array below, the first five (0-4) nested "sub" arrays are good to stay, but "sub" arrays 5-11 ought to be deleted (or "removed" or "unset") because there is nothing the in [0] position.
Thanks in advance for any wisdom.
NOTE: I would like even better to not build a "sub" array if it's missing values, but my data source is really not great.
Array ( [0] => Array ( [0] => Raffle [1] => Pick of Live [2] => [3] => 100 [4] => 150 [5] => Cocktail Only [6] => Struggled a bit, offered some from the stage to hit the minimum )
[1] => Array
(
[0] => Raffle
[1] => Ticket/Tangible
[2] => $1000 gift certificate to Canlis
[3] => 25
[4] => Unlimited
[5] => Cocktail Only
[6] => Really don't know how this did, but the box was pretty full of tickets
)
[2] => Array
(
[0] => Game
[1] => Ticket/Tangible
[2] => The Horse Race. Everyone is a winner. Receive a gift certificate ranging from $25 to $99.
[3] => 25
[4] => Unlimited
[5] => Cocktail Only
[6] => Great participation
)
[3] => Array
(
[0] => Other
[1] => Mystery/ Blind Pull
[2] => Wine Pull
[3] => 25
[4] => 50
[5] => cocktail only
[6] => There was about a dozen or so left
)
[4] => Array
(
[0] => Other
[1] => Ticket/Tangible
[2] => Centerpiece sales
[3] => 25
[4] => 35
[5] => Pre & During
[6] => Unknown
)
[5] => Array
(
[0] =>
[1] =>
)
[6] => Array
(
[0] =>
[1] =>
)
[7] => Array
(
[0] =>
[1] =>
)
[8] => Array
(
[0] =>
[1] =>
)
[9] => Array
(
[0] =>
[1] =>
)
[10] => Array
(
[0] =>
[1] =>
)
[11] => Array
(
[0] =>
[1] =>
)
)`