How can I use the array_pop function to remove the last element from an array in PHP? Example code: - Biz Tech

How can I use the array_pop function to remove the last element from an array in PHP? Example code:

Listen
$fruits = array("apple", "banana", "orange");

$last_fruit = array_pop($fruits);

echo $last_fruit;