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
 Sort associative array     -  
 Fetch a key from an associative array     -  
 Array difference for associate array     -  
 do while loop and for loop C++ example help.     -  
 While loop     -  
 Do while loop     -  
 C++ While loop     -  
 I NEED SOME HELP IN THE FOR LOOP PLZ .. IAM JUST A BEGINNER     -  
 Why will my loop does not work     -  
 PIC Assembly For Loop Example     -  

Topic Tags

PHP Loops, PHP Arrays