简体   繁体   中英

How can I make the color of the text in my php code red?

I wanted to make the word "Unable" in red and "Used" in green Thanks for your help

$paragrap .= $used->NAME." - ".(empty($used->is_complete) ? 'Unable' : 'Used')." - ".$helper->timeLeft($used->created)."<br>";

You can do it using html and css. Here is an example using inline css.
$paragrap.= $used->NAME." - ".(empty($used->is_complete)? '<span style="color: red;">Unable</span>': '<span style="color: green;">Used</span>')." - ".$helper->timeLeft($used->created)."<br>";
enter link description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM