Created
October 8, 2010 10:14
-
-
Save akkunchoi/616594 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The Difference between json_encode/json_decode and Zend_Json | |
$arr = array('a' => 'b', 'c' => 'd'); | |
$arrJson = json_encode($arr); | |
var_dump(json_decode($arrJson)); // stdClass | |
$arr = array('a' => 'b', 'c' => 'd'); | |
$arrJson = Zend_Json::encode($arr); | |
var_dump(Zend_Json::decode($arrJson)); // array | |
$arr = array('a' => 'b', 'c' => 'd'); | |
$arrJson = Zend_Json::encode($arr); | |
var_dump(Zend_Json::decode($arrJson, Zend_Json::TYPE_OBJECT)); // stdClass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment