Good point. Something like this might work, but I did not test how fast the division is going to be:

```
<?php
$result = mt_rand();
while ($result > 0) {
	var_dump($result);
	echo (($result % 9) + 1)."\n";
	$result = floor($result / 9);
}
```