For your particular example, after you do array_merge, do implode on the resulting array, this will give you the desired output.
$Arr = [implode(array_merge($Arr1, $Arr2))]; // works for PHP 5.4+
$Arr = array(implode(array_merge($Arr1, $Arr2))) // for older versions
I have a suspicion that your requirements are a little more complex than that.
For more info on implode
, see: http://php.net/manual/en/function.implode.php
If you would like to join the values from multiple entries, try using array_map
:
$Arr1 = array('windows', 'floor', 'door');
$Arr2 = array('5.0', '6.0', '7.0');
$Arr = array_map(function($a, $b) { return $a . $b; }, $Arr1, $Arr2);
This will output:
Array
(
[0] => windows5.0
[1] => floor6.0
[2] => door7.0
)
For more info on array_map
, see: http://php.net/manual/en/function.array-map.php