<?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";
You have javascript disabled. You will not be able to edit any code.