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)." </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 </td>"; > > here was my output: > > <td>... <b>Never Cry Wolfe</b> ... </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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php