Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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] => 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
)**



>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You Can Simply Merge The Array And Re-Assign To Any Array

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading