Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

foreach to loop through an associative array

Tue Oct 28, 2008 1:34 am

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

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




Post a reply
  Related Posts  to : foreach to loop through an associative array
 Fetch a key from an associative array     -  
 Sort associative array     -  
 Array difference for associate array     -  
 do while loop and for loop C++ example help.     -  
 While loop     -  
 Do while loop     -  
 C++ While loop     -  
 Using include() Within a Loop     -  
 PIC Assembly For Loop Example     -  
 Breaking a Loop     -  

Topic Tags

PHP Loops, PHP Arrays