To help guide the original question, in order to display the logged in users on an IRC server all that you need to do is connect to the server and send along a specially formatted command that the server understands, nothing complicated at all. There are various implementations in PHP which make talking to IRC servers easier, faster, object-oriented and so on (a Google search should suffice) or you can learn to use PHP's built-in code to do things in a more low-level way (through sockets and such like, which most of the abstractions do anyway).
I've even made an IRC bot in the past with PHP, so PHP is more than capable of doing it. I'll see if I can dig up the code and show you the IRC commands you need to post through a socket to the IRC server.
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
But, I guess I missed the point a little bit, because now I see that he wants to send messages to an IRC server rather than create a chat server.
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
this line responds to PING requests sent by the IRC server, this allows each computer to know if the opposite end is still present and available, you will be disconnected if you don't respond to PING with the message sent, this line takes care of that.