PHP code example of robinthehood / terminal

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

    

robinthehood / terminal example snippets




use RobinTheHood\Terminal\Terminal;

$terminal = new Terminal();
$terminal->setColor(Terminal::RED);
$terminal->out("Hello world in red!\n");

$terminal->setColor(Terminal::GREEN); // use green color



use RobinTheHood\Terminal\Terminal;

$terminal = new Terminal();
$terminal->setColor(Terminal::RED);
$terminal->out("Hello world in red!\n");

$terminal->setColor(Terminal::GREEN);
$terminal->out("Hello world in green!\n");

$terminal->setColor(Terminal::BLUE);
$terminal->out("Hello world in blue!\n");



use RobinTheHood\Terminal\Terminal;

$terminal = new Terminal();
$terminal->setColor(Terminal::RED);
$terminal->setLineNumbersEnabled(true);
$terminal->out("Hello world in red with line number!\nThis is the 2. line.\n");