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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.