PHPRecent Posts

PHP add element to an array

How to add new element to an array using php.array_push() php core function can be use for this.It will adding new element to ad array.

$original = array( 'one','two','three','four','five' );
// before inserting
print_r($original);
echo '
'; // after inserting array_push($original,'THIS IS NEW'); print_r($original);

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

Comments are closed.

Next Article:

0 %