array_push

The array_push() function pushes elements onto the end of an array (acting in the opposite way to array_pop).

PHP

$programming = array('java', 'ruby', 'python', 'php');
array_push($programming, 'asp');
print_r($programming);
=> /* 
Array
(
    [0] => java
    [1] => ruby
    [2] => python
    [3] => php
    [4] => asp
)
*/

Ruby

programming = ['java', 'ruby', 'python', 'php'];
programming.push('asp');
=> # ["java", "ruby", "python", "php", "asp"]
By | 2009-10-15T22:41:12+00:00 July 20th, 2009|Categories: PHP, Ruby|Tags: , , |Comments Off on array_push

About the Author:

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.