codigo de smilies (1 min read)


$emoticons = array(
"/:-)/" => "smile.gif",
"/:)/" => "smile.gif",
"/8-)/" => "shades.gif",
"/(H)/" => "shades.gif",
"/:-o/" => "surprise.gif",
"/:-O/" => "surprise.gif",
"/:-|/" => "amused.gif",
"/:@/" => "angry.gif",
"/(au)/" => "car.gif",
"/:-S/" => "confused.gif",
"/:-s/" => "confused.gif",
"/:s/" => "confused.gif",
"/:S/" => "confused.gif",
"/:(/" => "sad.gif",
"/:-(/" => "sad.gif",
"/:d/" => "teeth.gif",
"/:D/" => "teeth.gif",
"/:-p/" => "tongue.gif",
"/:-P/" => "tongue.gif",
"/;-)/" => "winck.gif",
"/;)/" => "winck.gif",
);

foreach(array_keys($emoticons) as $key){
$emoticons[$key] = "img src='".$_emoticons_folder.$emoticons[$key]."' width=17 height=17";
}

function format_text($text){
global $emoticons;
return preg_replace(array_keys($emoticons),array_values($emoticons),$text);
}

Leave a Reply

Your email address will not be published. Required fields are marked *