PEAR Services_JSON , Question
Posted: Sat Apr 07, 2007 6:29 pm
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.
What i also want is:
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
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.
Code: Select all
$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));Code: Select all
$obj1->car2->color = function(){
javascript stuff.
};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