Last Updated: February 25, 2016
· joetannenbaum

Style terminal output when running PHP

If you're running PHP from the command line, it's useful to be able to style the output in some way to differentiate and debug.

Whether it's outputting different colors, displaying information as tables, or even adding a progress bar for a task, CLImate can help you out.

Some examples:

$climate->red('Whoa now this text is red.');
$climate->bold('Bold? Wow!');
$climate->lightGreen('It\'s not easy being (light) green.');
$climate->backgroundRed('Whoa now this background is red.');
$climate->backgroundRedBold('Whoa now this background is red and bold.');

And for something a little more complex:

      'Walter White',
      'Skyler White',
      'Walter White Jr.',

You get this:

| Walter White     | Father | Teacher    |
| Skyler White     | Mother | Accountant |
| Walter White Jr. | Son    | Student    |

There are a bunch of different options, including:


  'name' => 'Gary',
  'age'  => 52,
  'job'  => 'Engineer',

  'Other Thing',

$climate->flank('Look at me. Now.');

For installation and documentation, head over here.