<?php
$fruits = [
'citrus'=>[
'fruit one'=>'orange', 'fruit two'=>'lime'
],
'melon'=>[
'fruit one'=>'honeydew', 'fruit two'=>'cantaloupe'
],
'berry'=>[
'fruit one'=>'raspberry', 'fruit two'=>'strawberry'
],
'apple'=>[
'fruit one'=>'granny smith', 'fruit two'=>'fuji'
],
];
foreach(array_slice($fruits,0,2) as $fruitGroup) echo $fruitGroup['fruit one']."\n";
echo "\n";
foreach(array_slice($fruits,2,2) as $fruitGroup) echo $fruitGroup['fruit one']."\n";
preferences:
24.33 ms | 404 KiB | 5 Q