[Solved] php loop and array where element has to be removed after 3 times [closed]


$kids = array('Bob', 'Joe', 'Sue', 'Sara');

foreach ($kids as $key => $kid)
{
  for($i=1; $i<=3; $i++)
  {
    eat_fruit($kid);
  }
  // drop kid from kids
  unset($kids[$key]);
}

8

solved php loop and array where element has to be removed after 3 times [closed]