PHPAnsiCode is a library so that you can easily apply desired styles to your texts in the terminal.
composer require php-ansi-code/php-ansi-coderequire_once 'vendor/autoload.php'; // Original root
require_once '../vendor/autoload.php'; // Example folder rootecho Ansi::color('red', 'This is PHPAnsiCode lib');echo Ansi::red('This is PHPAnsiCode lib');echo (new Ansi)(['color' => 'red', 'text' => 'This is PHPAnsiCode lib']);echo (new Ansi)('red', 'This is PHPAnsiCode lib');echo (new Ansi)->bgGreen('This is PHPAnsiCode lib');echo Ansi::rgb(rand(0, 255), rand(0, 255), rand(0, 255), 'This is PHPAnsiCode lib');// open tags
echo Ansi::tagsToColor('Hi my name is <blue>ehsan <reset>');// open close tags
echo Ansi::tagsToColor('<bgRed>Hi my name is <bgGreen><black>ehsan</black></bgGreen></bgRed>', true);// Use multiple items at the same time
echo Ansi::bold(Ansi::scColor(rand(0, 255), 'My name is ehsan'));The PHPAnsiCode library has an MIT license. You can read this file LICENSE for more information.