1. Go to this page and download the library: Download phergie/phergie-irc-parser library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phergie / phergie-irc-parser example snippets
$stream = ":Angel PRIVMSG Wiz :Hello are you receiving this message ?\r\n"
. "PRIVMSG Angel :yes I'm receiving it !receiving it !'u>(768u+1n) .br\r\n";
$parser = new Phergie\Irc\Parser();
// Get one message without modifying $stream
// or null if no complete message is found
$message = $parser->parse($stream);
// Get one message and remove it from $stream
// or null if no complete message is found
$message = $parser->consume($stream);
// Get all messages without modifying $stream
// or an empty array if no complete messages are found
$messages = $parser->parseAll($stream);
// Get all messages and remove them from $stream
// or an empty array if no complete messages are found
$messages = $parser->consumeAll($stream);
/*
One parsed message looks like this:
array(
'prefix' => ':Angel',
'nick' => 'Angel',
'command' => 'PRIVMSG',
'params' => array(
'receivers' => 'Wiz',
'text' => 'Hello are you receiving this message ?',
'all' => 'Wiz :Hello are you receiving this message ?',
),
'targets' => array('Wiz'),
'message' => ":Angel PRIVMSG Wiz :Hello are you receiving this message ?\r\n",
)
*/