开发者

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?


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.


On the page you link to he says:

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜