Jump to content

[SOLVED] create a random number at a certain length


ballhogjoni

Recommended Posts

What's wrong with:

<?php
$str = rand(1000000000,9999999999);
echo $str;
?>

 

Ken

 

Because more than likely the highest number rand() can return is 2,147,483,647 since it generates an integer. 

 

can do

 

echo getrandmax();

 

to see what the highest number rand() will generate on your system.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.