<? $msg =":)"; function bbcode($msg) { $msg = str_replace(":)", "<IMG src=\"./smile/icon_smile.gif\">", $msg); } bbcode($msg); echo $msg; ?>