Re: running a function on an eregi-substring
| From: | Justin French | Date: | Tue, 20 May 2003 23:10:34 +0000 |
| Subject: | Re: running a function on an eregi-substring | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148345@lists.php.net to get a copy of this message | ||
I guess this might be what you're after?
<?
function makeBold($str)
{
return "<b>{$string}</b>";
}
$content = 'hello world';
echo makeBold($content);
?>
???
Justin
on 19/05/03 9:53 PM, Michiel van Heusden (michiel@aemulatio.nl) 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);
>
> echo $output;
>
> ?>
>
>