PHP Array Push

The Array Push method in PHP is used for Inserting elements Into an array. The Syntax goes something like this-

 

array_push($array,$element);

Where

$array is the Array

$element is the element that needs to be Inserted Into an array.

 

For Example-

$new_array=array();

array_push($new_array,2);

Now 2 is an element of the array.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s