|
Posted by David Grant on 01/20/06 16:53
George,
George Pitcher wrote:
> For info, I am trying to highlight search terms in results.
If you're searching and replacing within HTML, you ought to be aware of
issues if someone's search term happens to be an HTML tag or attribute.
For example, Alice might search for "href" and get the following:
<a <b>href</b>="URL">Text</a>
back, which is clearly fubar, which highlights the necessity for some
handy regex skills. Following a quick google, I found this page:
http://aidanlister.com/repos/?file=function.str_highlight.php
David
--
David Grant
http://www.grant.org.uk/
http://pear.php.net/package/File_Ogg 0.2.1
http://pear.php.net/package/File_XSPF 0.1.0
Navigation:
[Reply to this message]
|