PHP Programing language

adplus-dvertising
Write a Program to displaying a Multidimensional Array using For each
Previous Home Next
<head>
<title>Displaying a Multidimensional Array using For
each</title>
</head>
<body>
<?php
  $emp_data = array (array (Name=>"Aditya", Code=>
  "110", Hobby=> "A"),
                    array (Name=>"Mukund", Code=>
					"112", Hobby=> "B"),
                    array (Name=>"Somaru", Code=>
					"111", Hobby=> "C"),
                    array (Name=>"Harsh", Code=>
					"113", Hobby=> "D"),
  );
  foreach ($emp_data as $t) {
    foreach ($t as $key=>$ttwo) {
      echo "$key: $ttwo", "\n";
    }
    echo "\n";
  }
?>
</body>
</html>

Output:

Previous Home Next