quote:
Originally posted by Methos2
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....
The whole point in that is to test that you are setting the $text variable correctly and that you are executing the function correctly, you wont have to do that for the code once whe can make sure that it is working correctly.
also:
quote:
Originally posted by Madman
could you post your complete $smiley_list and $replacement_list, arrays? (the two limes that start with $smiley_list = Array, and $replacement_list = Array)