Hello Readers ,
If we have an array and we want to delete the last record in an array then their is a function called array_pop() .
The array_pop() function deletes the last element of an array.
Example :
<?php
$a=array("red","green","blue");
array_pop($a);
print_r($a);
?>
Output :
Array ( [0] => red [1] => green )
Here from above you will see the last element i.e. "blue" has been deleted from the array while using array_pop().
0 Comment(s)