Foreach loop in PHP
The foreach loop traverses each element of the array once. This loop is used only with array.
foreach($array as $variable)
$myfruits = ["Apple","Banana","Mango"];
foreach($myfruits as $item)
Output for the above code : Apple Banana Mango