'Using PHP in need two array value in one array
so the output is already shared formate. the final array should me array one value and array two value without any 0 and 1 index only the second array value need to add the same response
**// array one
Array
(
[success] => 1
[message] => success
[status_code] => 0
[data] => Array
(
[email] => [email protected]
)
[http_response] => 200
)
// array two
Array
(
[success] => 1
[message] => success
[status_code] => 0
[data] => Array
(
[name] => ram
)
[http_response] => 200
)
// output needed like this //
Array
(
[success] => 1
[message] => success
[status_code] => 0
[data] => Array
(
[email] => [email protected]
[name] => ram
)
[http_response] => 200
)**
Solution 1:[1]
You Can Simply Merge The Array And Re-Assign To Any Array
$array2['data'] = array_merge($array['data'],$array2['data']);
print_r($array2);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RaZoo |
