loop through php array
snippet in php

php loop through array

user7477

$clothes = array("hat","shoe","shirt");
foreach ($clothes as $item) {
	echo $item;
}

foreach loop array php

user7326

foreach (array as $value){ 
  //code to be executed; 
  print("value : $value");
} 

foreach (array as  $key => $value){ 
  //code to be executed; 
  print("key[$key] => $value");
} 

loop through php array

user8400

foreach (array_expression as $value)
    statement
foreach (array_expression as $key => $value)
    statement