array_splice Remove a portion of the array and replace it with something else : Array Function : Data Structure PHP Source Code


PHP Source Code » Data Structure » Array Function »

 

array_splice Remove a portion of the array and replace it with something else




<?php
   $states = array("Alabama""Alaska""Arizona""Arkansas""California""Connecticut");
   $subset = array_splice($states, 2, -1, array("New York""Florida"));
   print_r($states);
?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Array Function