<?php $my_array = ["apple"]; array_push($my_array, "orange"); ?>
PHP inbuilt function array_push() can be used to add items to an array. It takes a minimum of two required parameters as $array_name which is the name of the array in which item to be added and $item which is to be added in the array.
You can pass more than one item to array_push to be added to the array like below
<?php $subject = ["Math", "Physics"]; array_push($subject, "English", "Chemistry"); ?>