Tom: "Bahnhof" Bitte substantiierte Vorgangsbescheibung

Beitrag lesen

Hello,

$text = str_replace(":)"<img src="bild1.gif">", $text);
$text = str_replace(":("<img src="bild2.gif">", $text);
$text = str_replace(":D"<img src="bild3.gif">", $text);

Jetzt versteht auch der Blonde, was Stephan wollte...*gg*

Da kann man dann auch die Array-Methode von str_replace benutzen:

$smily[]=":)";
$smily[]=":(";
$smily[]=":D";

$img[]="<img src="bild1.gif">";
$img[]="<img src="bild2.gif">";
$img[]="<img src="bild3.gif">";

$text = str_replace($smily, $img, $text);

Und fertig ists.

Grüße

Tom