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:

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 7
Summer

轮子超 +1 :+1:

8年前 评论
Destiny

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

7年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!