1. Go to this page and download the library: Download irfantoor/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/ */
irfantoor / terminal example snippets
rfanTOOR\Terminal;
$t = new Terminal;
# printing with style
$t->write("Hello ", "green");
$t->writeln("World ", "red");
# use writeMultiple to write multiple lines.
$t->writeMultiple(
[
'These are multiple lines',
'with a common style applied',
'to all lines'
],
'bg_blue, white'
);
# reading from console
$response = $t->read("Are you ok? [Y/N] ", "info");
$t->write("you responded with: ");
$t->writeln($response, "info, reverse");