<?php $myarray = array('php', 'is', 'cool'); foreach($myarray as $key => $val) { echo "The value of index $key is: $val<BR>"; } foreach($myarray as $val) { echo "Value: $val<BR>"; } ?>