I'm trying to do some server/client programming and I already
have figured out how to create php arrays and translate those
arrays into json data. The thing is when using php arrays and
translating them into json data, the php arrays translate into
json objects holding name value pairs (curly bracket syntax {})
and they do not translate into JSON arrays (square brackets [] )
How do I create JSON objects in php that contain JSON arrays,
with square brackets? Any help would be great. Thanks.
creating JSON arrays (square brackets)
Moderator: General Moderators
Re: creating JSON arrays (square brackets)
It's automatically done when your array contains integer, zero-based keys (and you can't have non-integer keys in js arrays anyway).