How do I create an empty JSON array?
I tried $finalJSON["items"][0] = ''; but that gave me {"items":[""]}
I tried $finalJSON["items"][0] = null; but that gave me {"items":[null]}
What I actually want is {"items":[]}
How to achieve this?
JSONarray" (or "JSONobject").JSONis a portable text representation of some data structure. If you want to encode asJSONan empty array then create an empty array (array()or[]on PHP 5.4 and newer) and encode it usingjson_encode().