PHP code example of nafisc / ansi-util

1. Go to this page and download the library: Download nafisc/ansi-util 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/ */

    

nafisc / ansi-util example snippets


$stringBuilder = new \Ansi\StringBuilder;

echo $stringBuilder
         ->raw('Hello, ')
         ->underline('John Doe')
         ->resetUnderline()
         ->raw('. ')
         ->raw('This is ')
         ->color16(\Ansi\Color16::FG_RED, 'red')
         ->raw('.')
         .PHP_EOL;