I'm posting what i'm using for windows for connecting IRC using php :
Hope it helps
PHP Code:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">html{background:#000;color:#0F0;font:Verdana, Geneva, sans-serif;font-size:12px;}</style>
</head>
<body>
<?php
//Configuration
$nick = "Spl3enBot";
$user = "Spl3en";
$channel = "#whatever";
$server = "irc.server.net";
//Begin of the script
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_connect($socket, gethostbyname($server), 6667);
$in = "NICK ".$nick."\r\n";
$in .= "USER ".$user." 8 * : ".$user."\r\n";
$in .= "USERHOST Userhost\r\n";
$in .= "JOIN :".$server."\r\n";
socket_write($socket, $in, strlen($in));
while ($out = socket_read($socket, 1024)){
if (preg_match("/PING/i",$out)) socket_write($socket,"PONG ",strlen("PONG "));
echo "<font color=blue>Socket_read = <i>".$out."</i></font><br>";
}
socket_close($socket);
?>
</body></html>
Hope it helps