function say($target, $text, $count=NULL) { global $socket; $ex = explode("\n", $text); if ($count) { if (count($ex) > 5) { fputs($socket, "PRIVMSG ".$target.":Output is too large, only displaying 5 of ".count($ex)." lines.\n"); for ($x == 1; $x < 6; $x++) { fputs($socket, "PRIVMSG ".$target." :".$ex[$x]."\n"); } } else { foreach ($ex as $ex) { fputs($socket, "PRIVMSG ".$target." :".$ex."\n"); } } } else { foreach ($ex as $ex) { fputs($socket, "PRIVMSG ".$target." :".$ex."\n"); } } }