<?php function reverse($str) { $ret = ""; len=mb s trwidth( len=mbstrwidth(len = mb_strwidth(str,"GB2312"); for (i=0; i=0;i=0; i< len; len;len; i++) { arr[]=mb s ubstr( arr[]=mbsubstr(arr[] = mb_substr(str, $i, 1, "GB2312"); } return implode("", array_reverse($arr)); } print_r(reverse("字符串翻转"));