hello, i have a really simple code for replacing a string message containing smilies symbols for smilies images. heres my code:
$messagein= "smilies: =) =D =( (!)";
$smilies=mysql_query("SELECT * FROM smilies")or die(mysql_error());
$img="<img src='../shoutbox/smilies/".$smilie."' border='0' width='15' height='15'>";
$message=str_replace($symbol, $img, $messagein);
as it its, with the echo outside the while loop, it will only replace one smilie, the last in the mysql smilies table.
for obvious reasons, if i put the echo inside the while loop, it will repeat the message as many times as how many smilies i have in the mysql smilies table, what i dont want, i just want the message to show once, replacing all the smilies. how to do that?!
here's a list of my available smilies http://fael097.site11.com/test/test6.php
and here's my code i posted above, as its (not)working right now http://fael097.site11.com/test/test5.php
thank you in advance