I have a forum where users can use bbcode to add smilies to their posts. The problem is that some users submit posts with just a few words, but with 20-30-40-50 and more smilies. Is there any way how to control this so that each post can not contain more than 3-5 smilies and if it contains more, all smilies are deleted from the message?
Thank you.
$message = str_replace("[1]", "<img src=\"images/smilies1/1.gif\" height=\"22\" width=\"22\" alt=\"\" /> ", $message);
$message = str_replace("[2]", "<img src=\"images/smilies1/2.gif\" height=\"22\" width=\"22\" alt=\"\" /> ", $message);
$message = str_replace("[3]", "<img src=\"images/smilies1/3.gif\" height=\"22\" width=\"22\" alt=\"\" /> ", $message);