quote:
Originally posted by hmaster
He means that the code will only work if you put the text in the $text variable.
This is my news post 0:) :D :)
code:
<?php
$text = "This is my news post 0:) :D :)[";
$smiley_list = array(":)", "0:)", ":D", the rest of the smilies);
$replacement_list = array('<img alt="smiley" src="smilies/grin.gif" />', '<img alt="smiley" src="smilies/angel.gif" />', '<img alt="smiley" src="smilies/biggrin.gif" />', The rest of the replacements here, using this format: '<img alt="alttext" src="location' />");
$text = str_replace($smiley_list, $replacement_list, $text);
echo $text;
?>
but having to to do this throughout the code deifes the object of a 'shortcut' such as :), unless i have missed something here it would be alot simpler and quicker to just use the html tag <img> wouldnt it....