array_unshift() - Prepend elements in array

Prepend one or more elements at the beginning of a PHP array.

 

array_unshift(array &$array, mixed ...$values): int

array_unshift() accepts at least 2 params (since PHP version 7.3 the function can be called with only one parameter)

The first parameter is the array called by reference, new values will be added.  The next parameters are the values to added to the array.

Returns the new number of elements in the array.