Looping through an Enumerated Array : foreach « Statement « PHP






Looping through an Enumerated Array

 <?php
  $emp_det []= "A";
  $emp_det []= "B";
  $emp_det []= "C";
  $emp_det []= "D";
  $emp_det []= "E";
  $emp_det []= "F";
  foreach ($emp_det as $temp) {
    echo "$temp", "\n";
  }
?>

           
       








Related examples in the same category

1.Foreach Demo
2.Array element order and foreach()
3.Iterating through a multidimensional array with foreach()
4.Modifying an array with foreach()
5.Using foreach() to Iterate Through an Array
6.Using foreach() with numeric arrays
7.Displaying the contents of an array using a loop
8.Iterating Through Object Properties
9.Implementing the traversable Iterator