PHP Function Array_Push
php function array_push is an inbuilt PHP function that lets you push new values into the end of an array. It treats the array like a stack and then pushes the passed variables var1, var2... onto the array end. As a result the length of an array will increase by the number of values pushed into it. Moreover, the new elements will have numeric keys even if the original array has string keys.
The function accepts two parameters: the array and the list of values to be pushed into it. The list of values can be a bunch of integers or strings. The function will then add those new values to the end of the original array and return the new count of the array's elements.
Using this function is much faster than traversing an array and adding each value as $array[key] = value. Moreover, it also eliminates the need to use a new array variable for each key. It should be noted, however, that this function is not compatible with using the empty bracket notation in a loop since it will return a warning message if the empty bracket does not check if a variable is an array first. In such cases, it's better to use array_merge() or just loop through an array and add each element with $array[key] = value. For more information on how to do this in a loop, please refer to the linked article.