> For instance, if I had a response to a question, called
> $row['description'], and I > searched for "%bryan%", the word
> 'bryan' would be a different color within the field $row['description']?
>
One way to do this:
Instead of directly outputting data to the browser using something like echo or
print you can store all of your output in a variable. You can then use
str_replace or ereg_replace to change the text to the color you want. For
example...

$search_word = "bryan";
$your_output = "The person searched for the word " . $search_word . ", so I want
to make it a different color";

$your_colored_output = str_replace($search_word, "<font color="red">" .
$search_word . "</font>", $your_output);

echo $your_colored_output;

Something like that should do the trick (I haven't tested that code though).

- Jamie



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to