Re: eregi_replace()
| From: | John Taylor-Johnston | Date: | Fri, 09 Jul 2004 21:18:46 +0000 |
| Subject: | Re: eregi_replace() | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190110@lists.php.net to get a copy of this message | ||
$searchenquiry = "Never cry Wolfe"
and
$mydata->ST contains "... Never Cry Wolfe ..."
This code echos:
<td>".preg_replace ('/('.$searchenquiry.')/i' ,
"<b>$1</b>", $mydata->ST)." </td>
<td>... <b>Never cry Wolfe</b> ...</td>
But I want it to use the original text and echo:
<td>... <b>Never Cry Wolfe</b> ...</td>
Do-able?
> try this
> echo preg_replace ('/('.$searchenquiry.')/i' ,
> "<b>$1</b>", $mydata->JR);
John