PHP Array Merge

This section we illustrates how to merge the array in php

 
 

Share on Google+Share on Google+

PHP Array Merge

Ads

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

Advertisements

Ads

Posted on: October 28, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles