wujunze / php-cli-color
Simple and easy to use the PHP command-line output of color
Installs: 54 604
Dependents: 13
Suggesters: 0
Security: 0
Stars: 42
Watchers: 4
Forks: 17
Open Issues: 0
Requires
- php: >=5.6.0
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.5
- overtrue/phplint: ^0.2
- phpunit/phpunit: ^5.0
This package is auto-updated.
Last update: 2024-12-12 13:18:43 UTC
README
Simple and easy to use the PHP command-line output of color
Installation
composer require wujunze/php-cli-color
How to use
<?php require_once __DIR__ . './../vendor/autoload.php'; $colors = new Wujunze\Colors(); // Test some basic printing with Colors class echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow"); echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray"); echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black"); echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green"); echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan"); echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan");