The same example as the example on top of the page, but the output is the returned array:


SUBMITTED BY: henry1874w

DATE: June 26, 2017, 4:43 p.m.

FORMAT: Text only

SIZE: 150 Bytes

HITS: 188

  1. <?php
  2. $a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
  3. $a2=array("a"=>"purple","b"=>"orange");
  4. print_r(array_splice($a1,0,2,$a2));
  5. ?>

comments powered by Disqus