https://github.com/wujunze/php-cli-color
Simple and easy to use the PHP command-line output of color
https://github.com/wujunze/php-cli-color
php php-cli php-library terminal
Last synced: 3 months ago
JSON representation
Simple and easy to use the PHP command-line output of color
- Host: GitHub
- URL: https://github.com/wujunze/php-cli-color
- Owner: wujunze
- License: mit
- Created: 2017-03-17T05:48:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T12:32:43.000Z (over 6 years ago)
- Last Synced: 2025-04-12T23:44:06.595Z (3 months ago)
- Topics: php, php-cli, php-library, terminal
- Language: PHP
- Size: 31.3 KB
- Stars: 42
- Watchers: 4
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-cli-color
Simple and easy to use the PHP command-line output of color[](https://travis-ci.org/wujunze/php-cli-color)
[](https://codecov.io/gh/wujunze/php-cli-color)
[](https://packagist.org/packages/wujunze/php-cli-color) [](https://packagist.org/packages/wujunze/php-cli-color) [](https://packagist.org/packages/wujunze/php-cli-color)## Installation
`composer require wujunze/php-cli-color`
## How to use
```php
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");
```## run result
