Skip to content

Simple and easy to use the PHP command-line output of color

License

Notifications You must be signed in to change notification settings

yangzhu6263736/php-cli-color

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-cli-color

Simple and easy to use the PHP command-line output of color

Installation

composer require wujunze/php-cli-color '~1.0'

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") . 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

About

Simple and easy to use the PHP command-line output of color

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%