I use this code to generate a 12 digits random number
<?php
for($i=0;$i<30;$i++)
echo rand(100000000000,999999999999) . '<br />';
?>
What is expect is to show me 30 line of 12 digits numbers
but the result is somethin like this :
37526702
941431838
-209515797
-57530698
629811980
284154102
-564127928
30944436
922278039
-20171894
633488561
259841230
975647758
817851289
43575270
-38791996
-120922063
672922853
1127336358
-561340843
-363576385
334440237
545013427
-32624829
-663158406
-379765199
-185321524
-92161715
984186913
-680296016
I have three problems now .
1 - I have some negative numbers , why ?
2 - This numers doesn't have 12 digits . why ?
3 - I don't have the above problems with random number with 11 digits
<?php
for($i=0;$i<30;$i++)
echo rand(10000000000,99999999999) . '<br />';
?>
Why ?