Jump to content

PEAR Services_JSON , Question


powerful0x0

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/46067-pear-services_json-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.