<?php $a=mt_rand(0,123456789); $num=$a; $num1=$num%10; $num=($num-$num1)/10; $num2=$num%10; $num=($num-$num2)/10; $num3=$num%10; $num=($num-$num3)/10; $num4=$num%10; $num=($num-$num4)/10; $num5=$num%10; $num=($num-$num5)/10; $num6=$num%10; $num=($num-$num6)/10; $num7=$num%10; $num=($num-$num7)/10; $num8=$num%10; $num=($num-$num8)/10; $num9=$num%10; echo "随机数是:{$a}<br>"; echo "亿位是{$num9}/t"; echo "千万位是{$num8}/t"; echo "百万位是{$num7}/t"; echo "十万位是{$num6}/t"; echo "万位是{$num5}/t"; echo "千位是{$num4}/t"; echo "百位是{$num3}/t"; echo "十位是{$num2}/t"; echo "个位是{$num1}/t"; ?>
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/98438.html