On Sat, 27 Dec 2003, Joshua wrote: > I'm trying to change the string, for example, > > $string = "11.abcd.32.efgh.53.ijk"; > to > > 11.abcd. > 32.efgh. > 53.ijk. > > with ereg_replace. Like > ereg_replace("\.[0-9]","<BR>",$string); > How can I recover the original characters after replacing them with <BR> > in ereg_replace? > > ereg_replace("\.[0-9]","<BR>\\0",$string) gives me the > wrong result like: > > 11.abcd. > 32.efgh. > 53.ijk.
Since the output you want and the output you didn't want are identical in your post, it was hard to tell what you were trying to do, but... I think this is what you want.. ereg_replace("(\.)([0-9])","\\1<br>\\2",$string); (minus the last decimal point, missing from your original string) -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php