Hi David,
Php is opening a whole new world of possibilities, but as you said, there is a bunch
of lines just to change the color, and this is normal!! We have to define things
all over again! (As I don't want to complicate things with php "procedures")
As you already discovered, php is only inserting html, php doesn't really exist
because the final result is a good old plain html file, what we've done with all
those lines are finally "translated" to <span style="color:#FF0000">33,9</span>.
As you see what I have done with that is just inserting an
inline css style, into
a non-effect tag (the <span style ="..." and choosen in advance that the only
style that I will use is color... so, I inserted the
color: and having to supply
only the color "number"...
But if I want to open the style option widely, I could do something like this:
<span style="'.$MyStyle.'"...Now, as you understant with $MyStyle variable, I don't want to only change temperature
color ($temp_color), but do my own styling, and not being limited in any way!! Last thing
to do is to revise my condition (if) accordingly, example:
if ($temp > 30)
{
$MyStyle = 'color:#FF0000; font-size: 120%; font-weight: bold';
\\ And so on as long as you want!!}
As you see, like that all is open... it's like a "brunch"... all you can eat!!!
Let's go and give your imagination a ride!!
Cheers,
Jacques