<?PHP

function getRev($str,$encoding='utf-8'){
$result = '';
$len = mb_strlen($str);
for($i=$len-1; $i>=0; $i--){
$result .= mb_substr($str,$i,1,$encoding);
}
return $result;
}
$string = 'OK你是正确的Ole';
echo getRev($string);
?>

转自:http://www.cnblogs.com/picaso/archive/2012/05/14/2500754.html

Related Posts: PHP-请写一个函数实现字符串翻转 :