Mega Code Archive

 
Categories / Php / Data Type
 

Using count() to Iterate Through an Array

<?php     $myarray = array('php', 'is', 'cool');     for($i = 0; $i < count($myarray); $i++) {       echo "The value of index $i is: {$myarray[$i]}<BR>\n";     } ?>