recycledbeans/colors

PHP 辅助函数,用于为 CLI 输出添加颜色。

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

This package is auto-updated.

Last update: 2024-08-29 05:06:09 UTC


README

一些辅助函数,用于在 PHP 控制台输出中添加一些颜色。

有多个函数可供使用。

// 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')

函数可以相互组合使用,或者插入到文本中间


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