Let's see what's wrong with this code.
$count = 123456789;
$str 1 = $str [Floor (Floor (Floor ($count/26)/26)/26)/26)/26)];
$str 2 = $str [Floor (Floor (Floor ($count/26)/26)/26)/26)%26];
$str 3 = $str [Floor (Floor ($count/26)/26)/26)%26];
$str 4 = $str [Floor (Floor ($count/26)/26)%26];
$str 5 = $str [Floor ($count/26)%26];
$str 6 = $str [$count%26];
echo $str 1. '
';
echo $str 2. '
';
echo $str 3. '
';
echo $str 4. '
';
echo $str 5. '
';
echo $str 6. '
';
?>
Report this error: Notice:string offset cast occurred in E:\www\rand.php on line 5
Share to:
------Solution--------------------
Check it out.
$n = Floor (Floor (Floor ($count/26)/26)/26)/26)/26);
Var_dump ($n);
Float (10)
The subscript should be an integral number, so
$str 1 = $str [Floor (Floor (Floor ($count/26)/26)/26)/26)/26)];
Should write
$str 1 = $str [Intval (Floor (Floor (Floor ($count/26)/26)/26)/26)/26)];
------Solution--------------------
References: Check it out.
$n = Floor (Floor (Floor ($count/26)/26)/26)/26)/26);
Var_dump ($n);
Float (10)
The subscript should be an integral number, so
$str 1 = $str [Floor (Floor (Floor ($count/26)/26)/26)/26)/26)];
Should write
$str 1 = $str [Intval (Floor (Floor (Floor ($count/26)/26)/26)/26)/26)];
Moderator powerful ha, I do not know from where to hand