How does the array_push() function in PHP help in manipulating arrays?

The array_push() function in PHP helps in manipulating arrays by adding one or more elements to the end of an array. This function is useful when you want to dynamically add elements to an array without having to specify the array keys.

<?php
// Initialize an empty array
$fruits = [];

// Add elements to the array using array_push()
array_push($fruits, "apple", "banana", "orange");

// Print the modified array
print_r($fruits);
?>