Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法创建执行以下场景的PHP代码,
小组中的 4 个孩子每人必须吃 3 个水果。一旦一个孩子吃了 3 个水果,他就必须被移出组,以此类推,直到组空。
$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]); }