Jump to content

rand


asmith

Recommended Posts

sorry i said it wrong .

i don't want rand give me repeated numbers :

 

$a = rand(1,100)

$b = rand(1,100)
while ($b == $a)
{$b = rand(1,100)}

 

that ! :) i was wondering maybe a specific function it has ?  and i don't need to code for that like above . it has ?

(then again  , it delete the $a from the range of the rand  , if $a was 13, then it get rand (1,100) , but without 13 included in that range,  that i don't have to check for being repeated)

 

 

Link to comment
https://forums.phpfreaks.com/topic/79567-rand/#findComment-402990
Share on other sites

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.