On the IBM developerWorks site there's a recent tutorial about using PHP and Javascript with the XMPP to create a small web-based notification tool (called Pingstream).
Real-time web applications are networked applications, with web-based user interfaces, that display Internet information as soon as it's published. Examples include social news aggregators and monitoring tools that continually update themselves with data from an external source. In this tutorial, you will create Pingstream, a small notification tool that uses PHP and JavaScript to communicate over the Extensible Messaging and Presence Protocol (XMPP), a set of XML technologies designed to support presence and real-time-communications functionality.
You'll need to already have the usual software installed - PHP, Apache and MySQL - as well as a few others: Openfire, jQuery, Strophe, XMPPHP and LastRSS. They introduce some of the concepts behind real-time messaging, the XAMPP protocol and, of course the code to show how to create their service.