You'll need to be a lot more specific. You've posted an array containing a single object. JSON.stringify converts that to a string representation. What were you trying to do? How were you doing it? What does "it doesn't work" mean in this case? What was the expected result? What happened instead?
Celauran wrote:You'll need to be a lot more specific. You've posted an array containing a single object. JSON.stringify converts that to a string representation. What were you trying to do? How were you doing it? What does "it doesn't work" mean in this case? What was the expected result? What happened instead?
The structure is correct (though the data is different). The only thing I see is the inconsistent highlighting within the HTML in that one screenshot...
You didn't need to post that ... I can see the stringified version! I was just pointing out that you get out what you put in.
You do need to use urlencode(), htmlspecialchars(), or something to put JSON as the value of a HTML tag. Specifically you need to encode the double quotes. Which encoding will depend on what the receiving page is expecting.