tags:

views:

96

answers:

3

What's the best Ajax library for PHP and why do you prefer it?

+1  A: 

For getting data out of PHP — http://uk3.php.net/json

For abstracting XMLHttpRequest in a cross browser fashion, converting JSON to JavaScript objects, and providing ways to insert that data into a document, I tend towards YUI, but this is largely a matter of personal taste.

David Dorward
+5  A: 

If you are searching for a library to facilitate Ajax Requests, it is not dependant of the server-side : launching Ajax requests is done on the client-side, in Javascript.

There are plenty of JS Frameworks to do lots of nice things, and, in the middle of those, Ajax Requests.
I've used those ones :

On the server-side, the JS Framework used doesn't make much different.


You might still want to take a look at the JSON format, which is great to exchange data between client and server when doing Ajax requests. There are several implementations in PHP that allows you to work with that one.
For instance :

  • With PHP >= 5.2 : json_encode and json_decode ; nice, as provided by PHP
  • Zend Framework has Zend_Json ; I've already used it on a PHP 5.1 server, outside of Zend Framework ; nice because I like ZF, and this component works on 5.1


If you want other informations, you might edit your question, to be more clear about what you want :-)

Pascal MARTIN
+1  A: 

It's depends on needs, but JSON is also worth a dig;

http://json.org

adatapost