RE: problem encountered with stristr-based function

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

 



David,

No html involved. Just db results.

I've found that eregi_replace() does the job adequately, if not perfectly.
Us typesetters are hard to please when it comes to string handling.

Cheers

George

> -----Original Message-----
> From: David Grant [mailto:djg@xxxxxxx]
> Sent: 20 January 2006 2:54 pm
> Cc: php-general@xxxxxxxxxxxxx
> Subject: Re:  problem encountered with stristr-based function
>
>
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
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