how to make the array using foreach statement in php code example
Example 1: php loop through array
$clothes = array("hat","shoe","shirt");
foreach ($clothes as $item) {
echo $item;
}
Example 2: for each php
<?php
foreach (array(1, 2, 3, 4) as &$value) {
$value = $value * 2;
}
?>