PHP code example of alecrabbit / php-console-colour

1. Go to this page and download the library: Download alecrabbit/php-console-colour 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/ */

    

alecrabbit / php-console-colour example snippets


$themes = new Themes();
echo $themes->red('This text is red.') . PHP_EOL;
echo $themes->underlinedBold('This text is underlined and bold.') . PHP_EOL;

// "\033[2;3mThis text is dark and italic.\033[0m"
$colorized = $themes->darkItalic('This text is dark and italic.')

/**
 * @method comment(string $text)
 * @method error(string $text)
 * @method info(string $text)
 *
 * @method yellow(string $text)
 * @method red(string $text)
 * @method green(string $text)
 * @method cyan(string $text)
 * @method magenta(string $text)
 *
 * @method italic(string $text)
 * @method bold(string $text)
 * @method dark(string $text)
 * @method darkItalic(string $text)
 * @method white(string $text)
 * @method whiteBold(string $text)
 * @method underlined(string $text)
 * @method underlinedBold(string $text)
 * @method underlinedItalic(string $text)
 */