PHP code example of chrismou / php-irc-text-formatting
1. Go to this page and download the library: Download chrismou/php-irc-text-formatting 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/ */
chrismou / php-irc-text-formatting example snippets
protected $format;
function __construct(array $config=array())
{
$this->format = new \Chrismou\Irc\TextFormatting\Format;
...
}
public function foo
{
$format = new \Chrismou\Irc\TextFormatting\Format;
...
}
$format = new \Chrismou\Irc\TextFormatting\Format;
$format->color("This text will be red", "red");
$format->color("This text will be blue on a green background", "blue", "green");
$format = new \Chrismou\Irc\TextFormatting\Format;
$format->style("This text will be underlined", "underline");
$format = new \Chrismou\Irc\TextFormatting\Format;
$format->rainbow("This text will be FABULOUS"); // produces rainbow coloured text