Jump to content

[SOLVED] Adding style="color:red" to php


rawky1976

Recommended Posts

Hi

 

I have an array that displays all errors in form input. I want them to be red, how do I apply styles to this line (ie <...style="color:red"...> : -

 

echo " - $msg<br />\n";

 

which appears inside: -

 

} else {

        echo 'Error! <p>The following error(s) occurred: <br />';

        foreach($errors as $msg){
        echo " - $msg<br />\n";

        }

 

???, thank you!

Link to comment
https://forums.phpfreaks.com/topic/67123-solved-adding-stylecolorred-to-php/
Share on other sites

Simply add the html tags you want...

 

} else {

        echo 'Error! <p>The following error(s) occurred: <br />';

        foreach($errors as $msg){
        echo "<...style=\"color:red\"...> - $msg</...><br />\n";

        }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.