كود PHP:
function parse_smilies($text, $do_html = false)
{
$cache =& $this->cache_smilies($do_html);
$this->local_smilies =& $cache;
$quoted = array();
foreach ($cache AS $find => $replace)
{
$quoted[] = preg_quote($find, '/');
}
$text = preg_replace_callback('/(?<!&|"|<|>|©|&#[0-9]{1}|&#[0-9]{2}|&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5})(' . implode('|', $quoted) . ')/s', array(&$this, 'replace_smilies'), $text);
/*foreach ($cache AS $find => $replace)
{
$text = preg_replace('/(?<!&|"|<|>|©|&#[0-9]{1}|&#[0-9]{2}|&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5})' . preg_quote($find, '/') . '/s', $replace, $text);
}*/
return $text;
}
كود PHP:
function parse_smilies($text, $do_html = false)
{
$cache =& $this->cache_smilies($do_html);
foreach ($cache AS $find => $replace)
{
$text = preg_replace('/(?<!&|"|<|>|©|&#[0-9]{1}|&#[0-9]{2}|&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5})' . preg_quote($find, '/') . '/s', $replace, $text);
}
return $text;
}
مواقع النشر (المفضلة)