$myArray = [1,2,3]; foreach ($myArray as $item) { echo $item; } $myAssocArray = [1=>'One',2=>'Two',3=>'Three']; foreach ($myAssocArray as $key => $value) { echo $key . ' is ' . $value; }