PHP code example of phergie / phergie-irc-generator

1. Go to this page and download the library: Download phergie/phergie-irc-generator 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-generator example snippets



$generator = new \Phergie\Irc\Generator();
$messages = $generator->ircPass('password')
    . $generator->ircNick('nick')
    . $generator->ircUser('username', 'hostname', 'servername', 'realname')
    . $generator->ircJoin('#channel1,#channel2')
    . $generator->ircPrivmsg('#channel1', 'Hello world!');
echo $messages;

/*
Output:
PASS :password
NICK :nick
USER username hostname servername :realname
JOIN :#channel1,#channel2
PRIVMSG #channel1 :Hello world!

*/


curl -s https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit Phergie/Irc/GeneratorTest.php