Output the value of the current, next and previous element in the array:


SUBMITTED BY: henry1874w

DATE: June 27, 2017, 5:11 p.m.

FORMAT: Text only

SIZE: 151 Bytes

HITS: 429

  1. <?php
  2. $people = array("Peter", "Joe", "Glenn", "Cleveland");
  3. echo current($people) . "<br>";
  4. echo next($people) . "<br>";
  5. echo prev($people);
  6. ?>

comments powered by Disqus