What is the correct syntax for adding elements to an array in PHP?

To add elements to an array in PHP, you can use the array_push() function. This function appends one or more elements to the end of an array. The syntax for array_push() is as follows: array_push($arrayName, $element1, $element2, ...). This allows you to easily add new elements to an existing array without having to manually specify the index.

$myArray = array("apple", "banana", "cherry");
array_push($myArray, "date", "fig");
print_r($myArray);