Displaying a Multidimensional Array using For each : Multidimensional Array : Data Structure PHP Source Code


PHP Source Code » Data Structure » Multidimensional Array »

 

Displaying a Multidimensional Array using For each



<?php
  $emp_det = array (array (Name=>"a", Code=> "8", Hobby=> "A"),
                    array (Name=>"b", Code=> "8", Hobby=> "B"),
                    array (Name=>"c", Code=> "1", Hobby=> "C"),
                    array (Name=>"d", Code=> "3", Hobby=> "D"),
  );
  foreach ($emp_det as $tempone) {
    foreach ($tempone as $key=>$temptwo) {
      echo "$key: $temptwo""n";
    }
    echo "n";
  }
?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Multidimensional Array