R4R Team working to provide free of cost for experienced and freshers

Tutorials | Examples|Interview Questions and Answers|Java Tutorials| C Tutorials | C++ Tutorials | Spring Tutorials| Hibernate Tutorials | JSP Tutorials | Servelets Tutorials| C# Tutorials | PHP Tutorials etc , Basics | Download Software | Data Types | Variables | Constant | Storage & Classes | Operators | Decisions Making | Loops | Functions| Numbers | Arrays | Pointers | String | Datastructure | Expressions | Preprocessor Statement | I/O | Exception Handling | OOPs Tutorial | Classes and object |C++ Inheritance Overloading | Polymorphism | Abstraction | Encapsulation | Interfaces | Multithreading etc

PHP Programing language

array_push() Function in PHP
Previous Home Next

array_push()

The array_push() function inserts one or more elements to the end of an array.

Syntax:
array_push(array,value1,value2...)

In above syntax, "array" specifies an array, "value1" specifies the value to add and "value2" specifies the value to add

Example:

<?php
$a=array("Apple","Banana");
array_push($a,"Mango","Orange");
print_r($a);
?>

Output:

Array ( [0] => Apple [1] => Banana [2] => Mango [3] => Orange )

Previous Home Next