Merge two objects in php -


i use api returns me email address given array this:

stdclass object (     [status] => ok     [contact] => stdclass object         (             [id] => 0000000             [email] => toto@free.fr             [last_activity] => 1362131446             [last_update] => 0             [created_at] => 1356617740             [sent] => 5             [open] => 1             [click] => 1             [spam] => 0             [bounce] => 0             [blocked] => 0             [queued] => 0         ) [lists] => array         (             [0] => stdclass object                 (                     [active] => 1                     [unsub] => 1                     [unsub_at] => 1363078528                 )          )  ) 

how merge info [contact] [lists] [0] in single object?

thank help

$info = yourstuff; $arrcontact = (array) $info->contact; $arrlist = (array) $info->lists[0]; $merged = array_merge($arrcontact, $arrlist); var_dump($merged, 'have fun'); 

quite trivial ;)


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -