Remove the first element (red) from an array, and return the value of the removed element:


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 95 Bytes

HITS: 429

  1. <?php
  2. $a=array("a"=>"red","b"=>"green","c"=>"blue");
  3. echo array_shift($a);
  4. print_r ($a);
  5. ?>

comments powered by Disqus