<?php
//use for printing arrays.
$x=array("Cat","Dog","Hen");
foreach($x as $value)
{
echo $value."<br>";
}
//======output=====
/*
Cat
Dog
Hen
*/
foreach($x as $key => $value)
{
echo $key."-".$value."<br>";
}
//======output=====
/*
0-Cat
1-Dog
2-Hen
*/
?>