Output the value of the current and the last element in an array:


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 121 Bytes

HITS: 496

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

comments powered by Disqus