Friday, September 18, 2009

Dr. StrangeFramework or how I learned to stop worrying and love the layers

Part 4 – json
Json is basically a universal standard way of formatting data ( which provide some benefits over XML (still being argued somewhere)…why not XML? One reason was that jQuery directly handled json and another was that everyone is talking about json….simple as that. In Part 3 I discussed how I started the json approach using static json data pages, the next step was to move from static to database/code provided data. Creating a json output in php is relatively easy (depending on the PHP release that you are on) – there’s a simple function json_encode(data) where data is typically a series of arrays/sub-arrays containing the data you want encoded. So, json encoding was the easy part, the difficult part was getting the data in the the array/sub-array/sub-sub-array layout that you wanted…next step, the data layer.

No comments:

Post a Comment