powerful0x0 Posted April 7, 2007 Share Posted April 7, 2007 Hello, im looking forward for good JSON to PHP and PHP to JSON class... It doesnot seems i have too many options at PHP4. i tried Pear Json and it seems good ... http://pear.php.net/pepr/pepr-proposal-show.php?id=198 just one thing i cant understand, how do i pass a real javascript function through PEAR json encoder/decorder. the class works good for any object or array/strings but im not sure how to pass a function and if it's possible. $value = array("foo" => "aaa", "bar", array(1, 2, "baz"), array(3, array(4))); $obj1->car1->color = "yea"; $obj1->car2->color = $value; echo($json->encode($obj1)); What i also want is: $obj1->car2->color = function(){ javascript stuff. }; I know it wouldnot be this way.. but how can i do through php? i want to pass real javascript function through the json object. Is it possible or i have to create my own engine at this case? Also if you have any good replacement for the PEAR class. please advice. Sorry if i'm not so clear, hope you got the main idea. Thanks, Samer Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.