.me.uk
-Original Message-
From: Nicolas Verhaeghe [mailto:[EMAIL PROTECTED]
Sent: 23 February 2006 00:55
To: 'Chris'
Cc: php-general@lists.php.net
Subject: RE: [PHP] Case issue with eregi_replace in text highlight
function
That's not where the issue is.
Eregi_replace co
rom: Nicolas Verhaeghe [mailto:[EMAIL PROTECTED]
Sent: 23 February 2006 00:55
To: 'Chris'
Cc: php-general@lists.php.net
Subject: RE: [PHP] Case issue with eregi_replace in text highlight function
That's not where the issue is.
Eregi_replace conducts a case insensitive SEARCH but how t
Nicolas Verhaeghe wrote:
That's not where the issue is.
Eregi_replace conducts a case insensitive SEARCH but how the REPLACE
operates has nothing to do with it.
If you use ereg_replace, then it is most obviously not going to replace
"MacOS" with "macos" or even "MacOS", because the string searc
ring searched for is of a
different case.
But thanks for helping.
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 5:39 PM
To: Nicolas Verhaeghe
Cc: php-general@lists.php.net
Subject: Re: [PHP] Case issue with eregi_replace in text highlight
Here is the function:
function highlight_text($text, $highlight) {
return eregi_replace($highlight, "" . $highlight .
"", $text);
}
In this case, if the text to highglight is:
MacOS X Super Gizmo
And a client searches for the string "macos", the result will be:
macos X Super Gizmo
You'
Hi all!
I have a text highlight function which does not behave exactly as
needed. Behavior is logical but result is cumbersome.
Instead of replacing the portion of the text with the same portion of
text with some highlighting code added before and after, it replaces the
said text with the chunk o
6 matches
Mail list logo