PHP helper functions to add colors to CLI output.

Maintainers

Package info

github.com/recycledbeans/php-color-console

pkg:composer/recycledbeans/colors

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-master 2018-08-08 14:45 UTC

This package is auto-updated.

Last update: 2026-03-01 00:12:07 UTC


README

Some helper functions to add some color to PHP console output.

There are a number of functions available.

// Displays blue text
echo textblue('Hello World');

// Displays black text
echo textblack('Hello World');

// Displays red text
echo textred('Hello World');

// Displays green text
echo textgreen('Hello World');

// Send a custom color integer.
echo textcolor('Hello World', 36);

// Sets the background to be inverted of the current terminal background
echo bginverted('Hello World');

// Prints text as a new line
echo println('Hello World')

Functions can be used together with each other or in the middle of text:


echo println( textgreen('Success: ') . 'File has finished downloading.' );