array_merge_recursive()
array_merge_recursive ( $array1, $array1 ....)
$array1 : Required , Input array 1 .
$array2 : Required , Input array 2 .
Resultant array as output of merging of elements
Example 1
$input1=array(1,2,3,4);
$input2=array(5,6,7);
echo print_r(array_merge_recursive($input1,$input2));
Output is here.
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 ) 1
Example 2
$input1=array("one"=>'first','Second'=>'2nd',3,4);
$input2=array("Five"=>'5th',6,7);
print_r(array_merge_recursive($input1,$input2));
Output is here.
Array ( [one] => first [Second] => 2nd [0] => 3 [1] => 4 [Five] => 5th [2] => 6 [3] => 7 )
Difference between arrays considering values →
← Array REFERENCE
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com