send email using php

PUSH DATA IN ARRAY PHP

Here is a very helpful function in php through which you can push data into array. Data will be inserted at the end of array, just like in the stack.

The function is array_push()

Example:

How to push data in array PHP

If you save some data into array;

 

$arr = array(“a”,”b”);

 

and now you can easily add other data into it using array_push() function as follows.

 

array_push($arr,”c”,”d”);

 

Now to verify this you can simply use print_r() function.

 

print_r($arr);

 

Output

Output clearly shows that data elements “c” and “d” have been pushed into array “$arr”.

Useful Links:

PHP Manual for array_push