This is an example to show how to connect to a IRC server, how to join a channel, send and receive messages.
<?PHP
$nickname = "myOwnNick";
$server = "irc.brasirc.net";
$channel = "#linux";
$port = "6667";
$ip = gethostbyname($server);
$id = ircg_pconnect($nickname,$ip,$port);
if (!ircg_is_conn_alive($id))
{
print "Cannot connect<br>";
exit;
}
if (!ircg_join($id,$channel))
{
print "Cannot join to $chanell<br>";
}
ircg_set_current($id);
ircg_msg($id,$channel,"Hello $channel!!");
ircg_msg($id,$nickname,"This message goes to me!!!");
?>