OK, so I have : an array(a) of arrays(b) of arrays(c).
I'm trying to iterate through the array and unset (or to be precise delete) all arrays at level 'c', with less than 3 items.
How would you go about it?
I've tried every possible use of unset
but I still can't the result I need.
foreach ($data as $a=>&$data_section)
{
foreach ((array)$data_section as $b=>$pattern)
{
if (count((array)$pattern)<3) { unset($data_section[$b]); }
}
}
This one gives an error :
Fatal error: Cannot unset string offsets