Same example as the one on top of the page, but with a loop to output the whole array:


SUBMITTED BY: henry1874w

DATE: June 26, 2017, 5:16 p.m.

FORMAT: Text only

SIZE: 166 Bytes

HITS: 385

  1. <?php
  2. $people = array("Peter", "Joe", "Glenn", "Cleveland");
  3. reset($people);
  4. while (list($key, $val) = each($people))
  5. {
  6. echo "$key => $val<br>";
  7. }
  8. ?>

comments powered by Disqus