Array is one of the most important part in every programming languages. PHP provides a very strong set of arrays.
Below is the list of arrays:
$myarray = array();
$myarray = “data 1”;
$myarray = “data 2”;
$myarray = “data 3”;
Merge one or more arrays.
Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one.
If the input arrays have the same string keys, then the later value for that key will overwrite the previous one or if the arrays contain numeric keys, then the later value will not overwrite the original value and will be appended.
Values in the input array with numeric keys will be renumbered with increment keys starting from zero in the result array.
Kindly have a look on example given below
$array1 = array(“color” => “green”, 2, 4);
$array2 = array(“a”, “b”, “color” => “blue”, “shape” => “sqaure”, 4);
$result = array_merge($array1, $array2);