changing color in php

rboulder

New Member
Hi,

I have a bit of php code to dynamically insert a keyword:

<?php
if ($_GET['kw'])
{echo ", including ";
echo ucwords($_GET['kw']);}
else
{echo ucwords("");}
?>

I want to change the color of the keyword only - I can change the color of the whole string including the string ", including ", by wrapping the whole thing in <font> tags, but I only want to change the keyword itself.

thanks,
rboulder
 

logoarena

New Member
uhm php prints out any html or css style so you can do something like this:

echo ', including <span style="color: #f00;">'.ucwords($_GET['kw']).'</span>';

or:

css:

.red {
color: #f00;
}

php:

echo ', including <span class="red">'.ucwords($_GET['kw']).'</span>';

...and so on
 
Top