StrRev() Dosent Support UTF-8

后端 未结 3 871
长情又很酷
长情又很酷 2021-02-15 18:50

I\'m trying to make a code that replace Arabic text to be supported in non Arabic supported programs
in that i will be need to reverse the text after replace but its shows s

3条回答
  •  既然无缘
    2021-02-15 19:17

    I have been using this one

    taken from here http://php.net/manual/en/function.strrev.php#122953

    function mb_strrev($str){
        $r = '';
        for ($i = mb_strlen($str); $i >= 0; $i--) {
            $r .= mb_substr($str, $i, 1);
        }
    
        return $r;
    }
    

提交回复
热议问题