Start the slice from from the second array element, and return only two elements:


SUBMITTED BY: henry1874w

DATE: June 25, 2017, 2:51 p.m.

FORMAT: Text only

SIZE: 90 Bytes

HITS: 841

  1. <?php
  2. $a=array("red","green","blue","yellow","brown");
  3. print_r(array_slice($a,1,2));
  4. ?>

comments powered by Disqus