PHP: script to generate 10 random numbers?

Hello experts,

I need to write a php script that randomly generates 10 digit numbers.

Any ideas?

thanks.
epifanio67Asked:
Who is Participating?
 
Cornelia YoderArtistCommented:
$number=rand()%1000000000;
0
 
Cornelia YoderArtistCommented:
The % is the "remainder" operator.  You can adjust the number of digits you get by adjusting the 1000000000 number.
0
 
epifanio67Author Commented:
thank you expert,

$number=rand()%1000000000;
it generates a random 5 digit number; but every time one refreshes the browser..

what I meant is: I need to create an array of random numbers
using rand(8,20)

see what I mean?

thanks,
regards
0
 
epifanio67Author Commented:
I got it... thank you
0
 
Cornelia YoderArtistCommented:
Glad you got what you needed ... it wasn't exactly clear from

   "...script to generate 10 random numbers" and
   "...script that randomly generates 10 digit numbers"

which it was that you actually needed, but creating an array of 10 numbers is pretty easy, so I figured you needed the other.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.