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


Leave a Reply


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