How to convert object to array to get the data?

Posted by Pinki | Updated on

Want to convert object to array to get the data? It is just normal object access:

But it depends on what you want to do. I suggest to have a look at the get_posts examples. They use setup_postdata to load the post content in the current context. If you want to display the post, this is probably the cleaner solution.


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