<?php
echo "Today is " . date("Y/m/d") . "<br>";
?>
Anyone know how to change the colour of the date within echo? this prints out the date but only in default black, thanks in advance.
<?php
echo "Today is " . date("Y/m/d") . "<br>";
?>
Anyone know how to change the colour of the date within echo? this prints out the date but only in default black, thanks in advance.
Method 1: You can use the line below. This is the simplest, but not the best way.
echo "<span style="color: white;"> Today is " . date("Y/m/d") . "</span><br>";
This basically prints out the date with a <span>
tag around it (which has a color of white). This will make the text white.
Method 2: You can use a class.
echo "<span class="anyClass"> Today is " . date("Y/m/d") . "</span><br>";
.anyClass {
color: white;
}
Try this code
echo "<p style='color: red'>Today is " . date("Y/m/d") . "</p><br>";