Function to combine arrays – PHP

<?php
 $testArray1 = array("place" => "kochi", 11, 12);
 $testArray2 = array("p", "s", "place" => "Tvm", "Width" => "10", 84);
 $testArray3 = array_merge($testArray1, $testArray2);
 print_r($testArray3);
 //Array ( [place] => Tvm [0] => 11 [1] => 12 [2] => p [3]
 //=> s [Width] => 10 [4] => 84 )
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>