RE: [PHP] Random Function

From: Date: Fri, 14 Nov 2003 18:42:39 +0000
Subject: RE: [PHP] Random Function
Groups: php.general 
Request: Send a blank email to php-general+get-169668@lists.php.net to get a copy of this message
Teren wrote: > Anyways, it works fine if I put 0 in for 1 on line 9 where it > uses the rand(), but it include 0 and I can't have 0. Why not just change the following: > if($ran == $sh) { > $add = "no"; > } to: > if($ran == $sh || $ran == 0) { > $add = "no"; > } That way you're testing for $ran to be 0, and if so then you do not add it. Cheers, Pablo

« previous php.general (#169668) next »