How do these 2 lines create a random 11 character string of letters and numbers?

```
$x = rand(10e12, 10e16);
echo base_convert($x, 10, 36);
```

$x is being set to a number longer than 11. How does base_convert() make 11?

Thanks

How do these 2 lines create a random 11 character string of letters and numbers?

```
$x = rand(10e12, 10e16);
echo base_convert($x, 10, 36);
```

$x is being set to a number longer than 11. How does base_convert() make 11?

Thanks

Since that function is dealing exclusively with numbers the length of the output will depend entirely on the size of the number being converted and the base you are converting it to.

Converting 10 base 10 to base 36 will give â€˜Zâ€™ which is a one character field.

If the from base is smaller than the to base then the result will have fewer digits than the original. If the from base is the larger then the result will be longer.

For example converting â€˜FFâ€™ base 16 to base 10 gives 255 which is a 3 character field.