Loop through and print all the values of an indexed array:


SUBMITTED BY: henry1874w

DATE: June 22, 2017, 12:01 a.m.

FORMAT: Text only

SIZE: 150 Bytes

HITS: 262

  1. <?php
  2. $cars=array("Volvo","BMW","Toyota");
  3. $arrlength=count($cars);
  4. for($x=0;$x<$arrlength;$x++)
  5. {
  6. echo $cars[$x];
  7. echo "<br>";
  8. }
  9. ?>

comments powered by Disqus