ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 preg_replace()改寫preg_replace_callback() 4 0
dragonfly 免費會員 2017-09-17 10:43:36 私信
POSCMS版本: 懸賞:5元

Severity: 8192 --> preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead /www/wwwroot/psctest/diy/dayrui/helpers/function_helper.php 2985

/**
 * 過濾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()

解決方案
  • /**
     * 過濾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;
    }
    滿意答案
    短信幣+1
    +5元
  • 首先要知道你這個報錯的原因是什么 php5.5版本以上 就廢棄了 preg_replace 函數中 /e 這個修飾符

    關于你放出來的這個這代碼 無非就是

    $tmpStr = preg_replace("#(\\\ud[0-9a-f]{3})#ie","", $tmpStr);

    里面含有了#ie 所以被判定用了 /e 修飾符 樓上的意見給你指出了 去掉e

  • 【徐樹】1樓 謝謝

  • 2017-09-17 18:04:40
    7小時21分鐘4秒 0

    【九天網絡(JiuDay)】2樓 謝謝

  • 2017-09-17 18:04:43
    7小時21分鐘7秒 0
    感謝大家給我解決此問題,我已經完美的解決