Skip to content

Commit a0fbc61

Browse files
committed
update README
1 parent b7703dc commit a0fbc61

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# php-cli-color
22
Simple and easy to use the PHP command-line output of color
3+
4+
5+
##Installation
6+
7+
composer require lijinma/php-cli-color '~1.0'
8+
9+
##How to use
10+
```php
11+
<?php
12+
13+
require_once __DIR__ . './../vendor/autoload.php';
14+
15+
$colors = new Wujunze\Colors();
16+
// Test some basic printing with Colors class
17+
echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow") . PHP_EOL;
18+
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray") . PHP_EOL;
19+
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black") . PHP_EOL;
20+
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green") . PHP_EOL;
21+
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan") . PHP_EOL;
22+
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan") . PHP_EOL;
23+
```
24+
25+
## run result
26+
27+
![code run result](http://ww4.sinaimg.cn/large/0060lm7Tgy1fdptvr70bdj30nl072zld.jpg)

0 commit comments

Comments
 (0)