fork download
  1. <?php
  2.  
  3. $food = array(
  4. "salty food" => array(
  5. "snack" => array(
  6. 0 => "Rufles",
  7. 1 => "Generic"
  8. )
  9. )
  10. );
  11.  
  12. echo "My preferred ";
  13. foreach ($food as $type1 => $value1) {
  14. echo $type1;
  15. echo " is the ";
  16. foreach ($value1 as $type2 => $value2) {
  17. echo "$type2 $value2[0]";
  18. }
  19. }
  20.  
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
My preferred salty food is the snack Rufles