I was looking at my database and there were places where jQuery had been used to make a JSON string:
{"0":"33"}
And then I saw places where there were JSON strings made from PHP json_encode like:
["News"," world news"," latest news"]
Do the brackets versus braces make a difference?
[]are used to create a simple array where{}creates an “object” used like an associative array in this case.The first example assign the value 33 to the index 0, but you can use anything as an index. In the second example, you’re creating a number indexed array.