Let's take a look at this code. what's the problem ;? Php $ str = 'abcdefghijklmnopqrstuvwxy'; & nbsp; $ count & nbsp ;=& nbsp; 123456789; $ str1 & nbsp ;=& nbsp; $ str [floo: Let's take a look at this code.
$str='abcdefghijklmnopqrstuvwxyz';
$count = 123456789;
$str1 = $str[floor(floor(floor(floor(floor($count/26)/26)/26)/26)/26)];
$str2 = $str[floor(floor(floor(floor($count/26)/26)/26)/26)%26];
$str3 = $str[floor(floor(floor($count/26)/26)/26)%26];
$str4 = $str[floor(floor($count/26)/26)%26];
$str5 = $str[floor($count/26)%26];
$str6 = $str[$count%26];
echo $str1.'
';
echo $str2.'
';
echo $str3.'
';
echo $str4.'
';
echo $str5.'
';
echo $str6.'
';
?>
This error is reported: Notice: String offset cast occurred in E: \ www \ rand. php on line 5
Share:
------ Solution --------------------
Test
$n = floor(floor(floor(floor(floor($count/26)/26)/26)/26)/26);
var_dump($n);
Float (10)
The subscript should be an integer, so
$ Str1 = $ str [floor ($ count/26)/26)/26)/26)];
Ying writing
$ Str1 = $ str [intval (floor ($ count/26)/26)/26)/26)];
------ Solution --------------------
Reference:
Test
$n = floor(floor(floor(floor(floor($count/26)/26)/26)/26)/26);
var_dump($n);
Float (10)
The subscript should be an integer, so
$ Str1 = $ str [floor ($ count/26)/26)/26)/26)];
Ying writing
$ Str1 = $ str [intval (floor ($ count/26)/26)/26)/26)];
The moderator is powerful. I don't know where to start for a long time.