<?php
function rev($str){
$len = strlen($str);
for($i=$len;$i>=0;$i--){
$newstr.=$str{$i};
}
return $newstr;
}
$str = "abcde";
$new = rev($str);
echo ‘<pre/>‘;
print_r($new);
本文出自 “学无止境” 博客,请务必保留此出处http://1294872.blog.51cto.com/1284872/1622945
原文:http://1294872.blog.51cto.com/1284872/1622945