foreach statement is used to loop through an associative array : Associative Array : Data Structure PHP Source Code


PHP Source Code » Data Structure » Associative Array »

 

foreach statement is used to loop through an associative array




<?php
$emp_det = array (Name => "A",
                  Age => "2" ,
                  Code =>"8",
                  Designation => "Administrator");

foreach ($emp_det as $key=>$temp) {
   echo "$key = $temp","n";
}
?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Associative Array