Re: regex issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Nov 2004 17:18:33 -0800, nate@xxxxxxxxxxxxxxxx
<nate@xxxxxxxxxxxxxxxx> wrote:
> All I want to do is capture the keyword (array, break, echo, etc) and color
> it.

I'd do it like this:

$source = 'this is a line of text';
$term = 'line';
$text = eregi_replace("($term)", "<font color=red>\\1</font>", $source);


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux