note 68069 deleted from function.ereg-replace by didou
| From: | didou@php.net | Date: | Mon, 22 Jan 2007 00:26:00 +0000 |
| Subject: | note 68069 deleted from function.ereg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122014@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at nncoders dot nospam dot de
----
Watch out when you use it for highlighting text.
It is case sensitive.
<?php
$textvar = "testTesttest";
$searchstring = "test";
$highlight = ereg_replace($searchstring, "<span
class=\"highlight\">".$searchstring."</span>", $textvar);
?>
Highlights like this: [text]Text[text]
The matching word with not matching case isn't parsed.