Re: eregi_replace()

From: Date: Sat, 10 Jul 2004 01:02:57 +0000
Subject: Re: eregi_replace()
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-190119@lists.php.net to get a copy of this message
Sorry. I have it working. My fault. I had a previous line: $mydata->ST = eregi_replace($searchenquiry, "<b>".$searchenquiry."</b>", $mydata->ST); THANKS! John "Matt M." wrote: > > $searchenquiry = "Never cry Wolfe" > > and > > $mydata->ST contains "... Never Cry Wolfe ..." > > > > This code echos: > > <td>".preg_replace ('/('.$searchenquiry.')/i' , > > "<b>$1</b>", $mydata->ST)."&nbsp;</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> > > I just tried this code: > > $searchenquiry = "Never cry Wolfe"; > $mydata = "... Never Cry Wolfe ..."; > $new = preg_replace ('/('.$searchenquiry.')/i' , > "<b>$1</b>", $mydata); > echo "<td>$new&nbsp;</td>"; > > here was my output: > > <td>... <b>Never Cry Wolfe</b> ...&nbsp;</td> > > isnt that what you want? -- John Taylor-Johnston ----------------------------------------------------------------------------- "If it's not open-source, it's Murphy's Law." ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064

« previous php.general (#190119) next »