字符串偏移量未设立

字符串偏移量未设置。PHP code$str1 no job no addressfunction Mystrrev($str1){$newstr $len

字符串偏移量未设置。

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--)