Jump to content

[SOLVED] Random number only once


PHPTOM

Recommended Posts

$num = array();

for($i=0;$i>12;$i++) {
$num[] = chooseRand();
}

function chooseRand() {
$n = rand(0,80);
if(in_array($n, $num) {
chooseRand();
} else {
return $n;
}
}

 

----------------

Now playing: Linkin Park & Jay-Z - Dirt Off Your Shoulder / Lying From You

via FoxyTunes

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.