Jump to content

tahakirmani2

New Members
  • Posts

    1
  • Joined

  • Last visited

tahakirmani2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I am trying to fetch values from a Multidimensional array using foreach loop, i have understand the basics of foreach(){} loop, but when it comes to Multidimensional array i get confused. This is my program <?php $food =array( 'Healthy' => array('Salad','Rice', 'Vegetables'=>array('Tomatto','Onion')) , 'UnHealthy' => array('pasta', 'Vegetables'=>array('potatto', 'Corn')) ); I want to print all vegetables in my output, i have tried various way to do it, and search a lot of examples but fond nothing useful. Kindly tell me the way to do it. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.