A PHP implementation of the XML-RPC web RPC protocol. Extra modules provide support for the JSON and JSONRPC protocols. A javascript version of the library is also available.
PHP-O-Lait is a library that, in 2 boiler-plate lines of code, allows you to call server-side PHP code from client-side JavaScript. It's so easy, in fact, that you don't need to know how it does it (hint, it uses Ajax and JSON).