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*

4
  • 3
    can you paste the resulting JSON code? Commented Jul 25, 2013 at 8:15
  • There is no chance that json_encode would result in an "invalid JSON format". Commented Jul 25, 2013 at 8:17
  • 1
    Seeing the invalid json would help, in any case you could start by adding header("Content-type","application/json"); at the beginning of the file. Commented Jul 25, 2013 at 8:17
  • well if that is really the resulting JSON, it misses mostly all the double-quotes around the variable names. Plus as Joe already said, there are spaces befor the JSON code begins what results in an error. Commented Jul 25, 2013 at 8:31