Like many other PHP developers, I have been playing with the new Zend Framework that is currently in the early stages of development. I have been building my entire homepage using it and these are some of my notes from a working with the current JSON, aka JavaScript Object Notation. Complete code for this example is available for download at the end of this article.
Zend_Json provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP.
JSON, JavaScript Object Notation, can be used for data interchange between JavaScript and other languages. Since JSON can be directly evaluated by JavaScript, it is a more efficient and lightweight format than XML for exchanging data with JavaScript clients.
In Part 8 of this series, we added Yahoo!, Amazon, and Flickr results to the Chomp application. Now we're going to improve performance by loading only the data the user requests, when the user requests it.
The recent release of php 5.2.0, which includes by default an extension for converting php values from and to the JSON format, is a good occasion for comparing the different existing php libraries which aim to provide the same capabilities.