PHP » PYTHON |
login |
register |
about
|
PYTHON array_push
is this article helpful?
|
Python replacement for PHP's array_push
[
edit
| history
]
myList.append(var) myList.extend([var1, var2, ...]) array_push(PHP 4, PHP 5) array_push — Push one or more elements onto the end of array Descriptionarray_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. Has the same effect as:
<?phprepeated for each var .
Parameters
Return ValuesReturns the new number of elements in the array. Examples
Example #1 array_push() example
<?phpThe above example will output:
Array
(
[0] => orange
[1] => banana
[2] => apple
[3] => raspberry
)
See Also
|
more
Recently updated
more
Most requested
|