更改PHP文本的颜色 [英] Changing the color of PHP text

查看:152
本文介绍了更改PHP文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道您是否可以更改打印颜色和回显文本,以使它在HTML页面上显示时不会只是黑色?干杯。

I was wondering if you can change the colour of your print and echo text so that when it is displayed on your HTML page it's not simply in black? Cheers.

推荐答案

如果您使用html进行此操作,请始终这样做。

If you're doing this in html, always.

<?php echo "<span style='color:blue;'>blue text</span>"; ?>

如果您在命令行中执行此操作,则有所不同。您需要创建一个库或找到一个现有的库。示例: http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command- line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors /

If you're doing this in command line, it's a bit different. You'd need to create a library or find an existing one. Example: http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/

这篇关于更改PHP文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆