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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -