convert object to array

Hi Friends

Today I was trying to convert an object to array. I tried many functions but no luck. Search on google and find lots of function’s that convert obejct to array but again no luck. I found a good way to convert object to array and I would like to share with you.

 

$array = json_decode(json_encode($res[1]), true);

 

Cheers 🙂

 

 

 

Share This Post

Recent Articles

One Response to “convert object to array”

  1. Gyan says:

    Its great helpful for my project

    thanks

Leave a Reply

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.

© 2017 Networkocean. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie