Severity: 8192 --> preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead /www/wwwroot/psctest/diy/dayrui/helpers/function_helper.php 2985
/**
* 過(guò)濾emoji表情
* @param type $str
* @return type
*/
function dr_clear_emoji($str){
$tmpStr = json_encode($str); //暴露出unicode
$tmpStr = preg_replace("#(\\\ud[0-9a-f]{3})#ie","", $tmpStr);
$new_str = json_decode($tmpStr);
return $new_str;
}求改寫成preg_replace_callback()
/** * 過(guò)濾emoji表情 * @param type $str * @return type */ function dr_clear_emoji($str){ $tmpStr = json_encode($str); //暴露出unicode $tmpStr = preg_replace("#(\\\ud[0-9a-f]{3})#i","", $tmpStr); $new_str = json_decode($tmpStr); return $new_str; }首先要知道你這個(gè)報(bào)錯(cuò)的原因是什么 php5.5版本以上 就廢棄了 preg_replace 函數(shù)中 /e 這個(gè)修飾符
關(guān)于你放出來(lái)的這個(gè)這代碼 無(wú)非就是
$tmpStr = preg_replace("#(\\\ud[0-9a-f]{3})#ie","", $tmpStr);里面含有了#ie 所以被判定用了 /e 修飾符 樓上的意見(jiàn)給你指出了 去掉e
【徐樹】1樓 謝謝
【九天網(wǎng)絡(luò)(JiuDay)】2樓 謝謝