PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

array_push

Tags: PHP 5.x PHP 7.x PHP 8.x

array_push — Push one or more elements onto the end of array.

Description

array_push(
    array &$array,
mixed ...$values
): int
array_push() treats array as a stack, and pushes the passed variables onto the end of array. The length of array increases by the number of variables pushed.

Parameters

array
The input array.
values
The values to push onto the end of the array.

Return Values

Returns the new number of elements in the array.