1. Go to this page and download the library: Download metashock/jm_console 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/ */
metashock / jm_console example snippets
// uire_once 'Jm/Autoloader.php';
// get an instance of Jm_Console
$console = Jm_Console::singleton();
$console->write('foo'); // writes foo to stdout
$console->writeln('foo'); // writes foo to stdout and adds a newline
$console->error('foo'); // writes foo to stderr
$console->errorln('foo'); // writes foo to stderr and adds a newline
$console->writeln('hello, world!', 'green'); // writes green text to stdout
$console->errorln('an error occured!', 'red'); // writes red text to stderr
$console->writeln('Booh!', 'bold'); // writes bold text to stdout
$console->writeln('I\'m a link!', 'underline'); // writes underlined text to stdout
$console->writeln('Booh!', 'blue,bold'); // writes bold blue text to stdout
$console->writeln('I\'m a link!', 'yellow, underline'); // writes underlined yellow text to stdout
$console->writeln('Booh!', 'white,bg:blue'); // writes white text on a blue background to stdout
$console->cursorPosition(0, 0); // positioning the cursor at upper left corner
$console->savecursor(); // saves the cursor position
// ...
$console->restorecursor(); // restores the cursor position