使用 PHP 需要一个数组中的两个数组值

Using PHP in need two array value in one array

所以输出已经是共享甲​​酸盐。最终数组应该是我数组一个值和数组两个值没有任何 0 和 1 索引只有第二个数组值需要添加相同的响应


**// array one 
Array
(
    [success] => 1
    [message] => success
    [status_code] => 0
    [data] => Array
        (
            [email] => naeemmalik036@gmail.com
        )
    [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] => naeemmalik036@gmail.com
            [name] => ram
        )
    [http_response] => 200
)**



您可以简单地将数组合并 Re-Assign 到任何数组

$array2['data'] = array_merge($array['data'],$array2['data']);
print_r($array2);