Regular filtration special expressions

/**[ Filter and upload special emoticons Symbolic]

* @param $str
* @return mixed
*/
function filter_emoji($str)
{
$str = preg_replace_callback( //Perform a regular expression search and replace with a callback
‘/./u’,
function (array $match) {
return strlen($match[0]) >= 4?'': $match[0];
}
,
$str);

return $str;
}

/**[Filter uploading special emoticons]

* @param $str
* @return mixed
*/
function filter_emoji($str)
{
$str = preg_replace_callback( //Perform a regular expression search and replace with a callback
‘/./u’,
function (array $match) {
return strlen($match[0]) >= 4?'': $match[0];
}
,
$str);

return $str;
}

Leave a Comment

Your email address will not be published.