$data = array("name"=>"John", "age"=>30, "city"=>"New York"); $json_data = Zend_Json::encode($data); echo $json_data;
$json_data = '{"name":"John", "age":30, "city":"New York"}'; $data = Zend_Json::decode($json_data); echo $data->name;This example demonstrates how to decode JSON data into a PHP object. We use the `Zend_Json::decode()` method to do this. The resulting object is then printed to the screen, accessing the "name" property using the `->` operator. In conclusion, the Zend_Json package library provides a simple yet powerful way to work with JSON data in PHP. It's a great tool for developers who want to create web applications with JSON at its core.