-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wujunze/dev
update README
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# php-cli-color | ||
Simple and easy to use the PHP command-line output of color | ||
|
||
|
||
## Installation | ||
|
||
composer require lijinma/php-cli-color '~1.0' | ||
|
||
## How to use | ||
```php | ||
<?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") . PHP_EOL; | ||
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray") . PHP_EOL; | ||
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black") . PHP_EOL; | ||
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green") . PHP_EOL; | ||
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan") . PHP_EOL; | ||
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan") . PHP_EOL; | ||
``` | ||
|
||
## run result | ||
|
||
![code run result](https://camo.githubusercontent.com/5509dd50a0f9fb194a6bc2a36153934e3d74e1d9/687474703a2f2f7777342e73696e61696d672e636e2f6c617267652f303036306c6d3754677931666470747672373062646a33306e6c3037327a6c642e6a7067) |