Hi,
I've been searching the archive of this forum for ereg_replace examples but I can't seem to find my particular problem.
Shouldn't be hard for the experts around I figure:
I have this string:
Hi %this% is a %test%
And I want this replaced by this:
Hi <b>this</b> is a <b>test</b>
So far, I got this:
$line = ereg_replace("%(.*)%", "<b>\1</b>", $line);
This works if there are no more than 1 occurences in $line, however if I use above example with this all I get is:
Hi <b>this% is a %test</b>
It seems ereg_replace looks for the first occurence and the last occurence. How can I make him also look for more occurences and handle them correctly?
Thank you for your time,
Martin.