How to convert object to an array in PHP?

Posted by Pinki | Updated on

Want to convert object to an array in PHP? Initially json_encode() function returns a JSON encoded string for a given value.The json_decode() function changes over it into a PHP array.

Here is an example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers