PHP Programing language

array_merge() Function in PHP
Previous Home Next

array_merge()

The array_merge() function merges or combine one or more arrays into another array.

Syntax:
array_merge(array1,array2,array3...)

 

In above syntax,"array1" specifies an array, "array2" specifies an array and "array3,..." specifies an array

Example:

<?php
$array1=array("Apple","Banana");
$array2=array("Orange","Mango");
print_r(array_merge($array1,$array2));
?>

Output:

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

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: