Re: Random pick

From: Date: Mon, 25 Jan 2010 19:32:27 +0000
Subject: Re: Random pick
References: 1 2 3 4 5 6 7  Groups: php.db 
Request: Send a blank email to php-db+get-46796@lists.php.net to get a copy of this message
On Mon, 25 Jan 2010, Karl DeSaulniers wrote:
Hello List, Trying to learn the right way to code this line. Can anyone tell me if I am doing this the right way? if $req_user_level == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 ? "Guest" || "Regular User" || "Intl. User" || "Contractor" || "Employee" || "Sales" || "Investor" || "Human Resources" || "Administrator"; I am wanting to stray from the if(foo == bar) { routine. ;)
if (in_array($req_user_level, array(0,1,2,3,4,5,6,7,8,9,"Guest",...))) {
     // do stuff
} ---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman@angryox.com                                 http://www.angryox.com/
---------------------------------------------------------------------------

« previous php.db (#46796) next »