public function afterParse($content) {
        $smilies = $this->getSmilies();

        // Build the smilies regex
        $smiliesRegex = implode('|', array_map(function ($smile) {
            return preg_quote($smile, '/');
        }, $smilies));

        $pattern = sprintf('/(?:(?<=[\s.;>:)])|^)(%s)/', $smiliesRegex);
        $content = preg_replace_callback($pattern, array($this, '_emoticonCallback'), $content);

        $pattern = sprintf('/(%s)(?:(?=[\s.&<:(])|$)/', $smiliesRegex);
        $content = preg_replace_callback($pattern, array($this, '_emoticonCallback'), $content);

        return $content;
    }
public function afterParse($content) {
        $smilies = $this->getSmilies();

        // Build the smilies regex
        $smiliesRegex = implode('|', array_map(function ($smile) {
            return preg_quote($smile, '/');
        }, $smilies));

        $pattern = sprintf('/(?:(?<=[\s.;>:)])|^)(%s)/', $smiliesRegex);
        $content = preg_replace_callback($pattern, array($this, '_emoticonCallback'), $content);

        $pattern = sprintf('/(%s)(?:(?=[\s.&<:(])|$)/', $smiliesRegex);
        $content = preg_replace_callback($pattern, array($this, '_emoticonCallback'), $content);

        return $content;
    }
public function afterParse ( $ content ) { $ smilies = $ this -> getSmilies ( ) ; // Build the smilies regex $ smiliesRegex = implode ( '|' , array_map ( function ( $ smile ) { return preg_quote ( $ smile , '/' ) ; } , $ smilies ) ) ; $ pattern = sprintf ( '/(?:(?<=[\s.;>:)])|^)(%s)/' , $ smiliesRegex ) ; $ content = preg_replace_callback ( $ pattern , array ( $ this , '_emoticonCallback' ) , $ content ) ; $ pattern = sprintf ( '/(%s)(?:(?=[\s.&<:(])|$)/' , $ smiliesRegex ) ; $ content = preg_replace_callback ( $ pattern , array ( $ this , '_emoticonCallback' ) , $ content ) ; return $ content ; }
Parse out the emoticons and replace with images.

@param string $content
@return string
Parse out the emoticons and replace with images .