Demo For: Using PHP To Remove Last Array Element / Item

Following are the original array contents:
Array
(
    [0] => apple
    [1] => mango
    [2] => grapes
    [3] => pineapple
)
Use array_pop($my_fruits_array) to remove last element from array.

Following are the array contents AFTER removing the last item from array:
Array
(
    [0] => apple
    [1] => mango
    [2] => grapes
)