Amdpower: Funktion: ereg_replace()

Beitrag lesen

Hi,
probiers mal mit preg_replace ...

Lösung:
<?php
$string="hallo das bild: #image:photo1: ist ok #image:photo2:";
$replaced = preg_replace('@#image:(.*?):@', '<img src="img/\1.gif">', $string);

echo "<b>String:</b> $string<br>";
echo "<b>Zerlegt:</b> $replaced";
?>

Gruß Amdpower