Re: [PHP-DB] Random pick

[email protected] (Olavi Ivask)
Newsgroups php.db
Message-ID <[email protected]>
Hi,

did you mean something like this?

$level_names = array("Guest", "Regular User", "Intl. User",  
"Contractor", "Employee",
			"Sales", "Investor", "Human Resources", "Administrator");

$user_level = $level_names[$req_user_level];

Regards,
Olavi Ivask


On Jan 25, 2010, at 9:13 PM, 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. ;)
>
> Thanks,
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.