Skip to content

Instantly share code, notes, and snippets.

@samundra
Last active January 5, 2016 08:52
Show Gist options
  • Save samundra/ef259cf396833c3922ba to your computer and use it in GitHub Desktop.
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.
<?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