Home Tutorial Php Phparray PHP Array Merge

 
 

Share on Google+Share on Google+
PHP Array Merge
Posted on: October 28, 2009 at 12:00 AM
Advertisement
This section we illustrates how to merge the array in php

  • In php two or more arrays can be added into a single array
  • It is done by the use of array_merge() function


Example of PHP Array Merge Function

<?php
$array1
=array(1,2,3);
$array2
=array(4,5,6);
$array3
=array_merge($array1,$array2);
foreach
($array3 as $a3)
echo
" ".$a3;?>

Output
1 2 3 4 5 6

Advertisement

Related Tags for PHP Array Merge:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 28, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com