Re: running a function on an eregi-substring

From: Date: Mon, 19 May 2003 11:16:11 +0000
Subject: Re: running a function on an eregi-substring
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148149@lists.php.net to get a copy of this message
On Mon, 19 May 2003 12:53:37 +0200, you wrote: >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); Having a hard time seeing what you're trying to do. You want your output string to look like this? <b>hello world</b> $output = makebold($content); Or like this? <b></b> world $output = eregi_replace ("hello", makebold(""), $output);

« previous php.general (#148149) next »