PDA

View Full Version : Random numbers generator



frenchboy
13 Nov 2008, 08:19 PM
Hi, I need a script that would make random numbers appear when the page loads. In that format

xxx-xxx-xxxx-xxx-xxx-xxxx

x being between 0 and 9.

how do I do that?

thanks

Alx
13 Nov 2008, 11:41 PM
Hi, I need a script that would make random numbers appear when the page loads. In that format
xxx-xxx-xxxx-xxx-xxx-xxxx
x being between 0 and 9.
how do I do that?
thanks




$a = rand(100,999);
$b = rand(100,999);
$c = rand(1000,9999);
$d = rand(100,999);
$e = rand(100,999);
$f = rand(1000,9999);

$code = $a.'-'.$b.'-'.$c.'-'.$d.'-'.$e.'-'.$f;