Appending Elements to an Array Using array_push() in PHP


Add one or more elements to the end of an array.

Source Code

$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
print_r($stack);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments