- PHP code
$str1 = "no job no address";
function Mystrrev($str1){
$newstr = "";
$len = strlen($str1);
for($i = $len; $i >= 0; $i--) {
$newstr .= $str1{$i};
}
return $newstr;
}
echo Mystrrev($str1);
警告:Notice: Uninitialized string offset
请问这个偏移量怎么设置。
------解决方案--------------------
for($i = $len-1; $i >= 0; $i--)