简体   繁体   中英

Arrays vs. JSON

Which is better in PHP ? Drew Wilson implies that arrays are hardly worth dealing with if possible: http://code.drewwilson.com/entry/an-introduction-to-json

Would it be wise of me to create all my future web apps with this in mind?

On the page you link to he says:

[arrays vs JSON is] Not a good comparison since JSON can have arrays inside of it

It is better for your to use json because it can hold both it's own key:value object data but also arrays, again all in the same object. Unless you are going to argue about sending arrays of json objects back to the client I suggest to you json is what you should use.

As it says in the article, Arrays vs JSON is not a good comparison. JSON can hold arrays, which are used frequently..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM