How can array_pop() be used to manipulate arrays in PHP?
The array_pop() function in PHP can be used to remove the last element of an array and return it. This can be useful when you want to manipulate arrays by removing elements from the end. To use array_pop(), simply pass the array you want to modify as an argument, and it will remove the last element from that array.
$fruits = ['apple', 'banana', 'orange'];
$lastFruit = array_pop($fruits);
print_r($fruits); // Output: ['apple', 'banana']
echo $lastFruit; // Output: orange