Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Got this when i tried the top solution:"Fatal error: Cannot use object of type stdClass as array in" Commented Dec 27, 2012 at 18:30
  • That's because the default for json_decode is as an object. I've added an edit (whenever it gets reviewed) which fixes that by setting the second parameter to decode as an array. As an alternative, you can access the default json_decode data using object notation in the first example like so: 'Title' => $data->Title, 'Plot' => $data->Plot Commented Dec 27, 2012 at 19:07