Right now I am using this function for emoticons:
function emoticons($text) {
$icons = array(
\':)\' => \'
I'm not sure whether it will work or not, but I'd try to put some extra spaces like this:
function emoticons($text) {
$icons = array(
' :) ' => '
',
' :-) ' => '
',
' :D ' => '
',
' :d ' => '
',
' ;) ' => '
',
' :P ' => '
',
' :-P ' => '
',
' :-p ' => '
',
' :p ' => '
',
' :( ' => '
',
' :o ' => '
',
' :O ' => '
',
' :0 ' => '
',
' :| ' => '
',
' :-| ' => '
',
' :/ ' => '
',
' :-/ ' => '
'
);
return strtr($text, $icons);
}