Last active
January 5, 2016 08:52
-
-
Save samundra/ef259cf396833c3922ba to your computer and use it in GitHub Desktop.
PHP Code snippet to view the color coding to be used in Console output. The color output can be directly used in the PHP code then for colourful output.
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 Code snippet to test the color coding for the CLI output | |
* In Console the output is: | |
* | |
* The code is 1;42m | |
* | |
* Run with - `php console_code_color.php` | |
* | |
**/ | |
$i = 20; | |
while($i<50){ | |
echo "\033[1;{$i}m"; | |
echo "\nThe code is 1;{$i}m\n\n"; | |
echo "\033[1;0m"; | |
$i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment