PHP Remove the last element of an array – PHP April 28, 2011 Pramod T P Leave a comment <?php $sampleDate = array("Test1", "Test2", "Test3", "Test4"); array_pop($sampleDate); print_r($sampleDate); // Array ( [0] => Test1 [1] => Test2 [2] => Test3 ) . // Test4 will be removed ?>