How to merge n number of array in php. I mean how can I do the job like : array_merge(from : $result[0], to : $result[count($result)-1]) OR<
array_merge(from : $result[0], to : $result[count($result)-1])
Try this
$result = array_merge($array1, $array2);
Or, instead of array_merge, you can use the + op which performs a union:
$array2 + array_fill_keys($array1, '');