Re: running a function on an eregi-substring

From: Date: Mon, 19 May 2003 19:20:33 +0000
Subject: Re: running a function on an eregi-substring
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148195@lists.php.net to get a copy of this message
My guess is that you want preg_replace("/(hello)(.*?)/ie","makeBold('\\1').'\\2'",$content); I think you can add flags to eregi_replace too, not sure though... "Michiel Van Heusden" <michiel@aemulatio.nl> skrev i meddelandet news:20030519105530.95251.qmail@pb1.pair.com... > i'm having trouble using eregi_replace in a script similar to the following > don't if this is possible at all but i'd like to know if this is possible, > how to fix it, any help? > > <? > > $content = "hello world"; > > function makebold ($string) { > return "<b>" . $string . "</b>"; > } > > $output = eregi_replace("hello", makebold(\\0), $content); > > echo $output; > > ?> > >

« previous php.general (#148195) next »