Remove the first and last item of the array – PHP

<?php
 $sampleData = array('10', '20', '30.30', '40', '50');
 array_shift($sampleData);
 array_pop($sampleData);
 print_r($sampleData); // Array ( [0] => 20 [1] => 30.30 [2] => 40 )
?>
Share

Leave a Reply

Your email address will not be published. Required fields are marked *