- stream_set_blocking: documentation ( source)
- fsockopen: documentation ( source)
- feof: documentation ( source)
- fgets: documentation ( source)
<?php
$socket = @fsockopen('tcp://irc.quakenet.org', 6667, $errno, $errstr);
if(!$socket) die($errstr . ' (' . $errno . ')');
stream_set_blocking($socket, 0);
while(!feof($msg = fgets($socket, 510))) {
echo $msg, "\n";
}