Created
December 2, 2013 12:57
PHP CLI colors
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
<?php | |
/* | |
* PHP CLI color display | |
* | |
* 3[x]: Foreground | |
* 4[x]: Background | |
* | |
* [3|4]0: Black | |
* [3|4]1: Red | |
* [3|4]2: Green | |
* [3|4]3: Yellow | |
* [3|4]4: Blue | |
* [3|4]5: Magenta | |
* [3|4]6: Cyan | |
* [3|4]7: White | |
* | |
*/ | |
echo "\033[40;30m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;31m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;32m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;33m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;34m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;35m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;36m Lorem ipsum dolor sit amet\033[0m\n"; | |
echo "\033[40;37m Lorem ipsum dolor sit amet\033[0m\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment