PHP Bash 文字彩色组件:overtrue/bash-color

又没忍住造了一个轮子,与 symfony 的 Console 组件中的彩色部分类似:

use Overtrue\BashColor\BashColor;

echo BashColor::render('<fg=green>Are you sure ?</><fg=yellow> [Y/n]:</>'), "\n";
echo BashColor::render('<fg=green;opt=underlined>yes!</>'), "\n";
echo BashColor::render('<fg=red>hello world!</>'), "\n";
echo BashColor::render('<fg=cyan;opt=bold;bg=red>ugly!</>'), "\n";

结果:

image

欢迎各位 star: https://github.com/overtrue/bash-color :kiss: :kiss: :kiss:

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 7
Summer

轮子超 +1 :thumbsup:

9年前 评论
Destiny

超哥顶,:thumbsup: , 最近用了好多你写的组件,真心棒!

8年前 评论