Re: Random pick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for this as well.
Question? What part is "in_array" playing?
Is it comparing $req_user_level to array()?
Because the text "Guest", etc.. is not in $req_user_level on the database. In other words, is it checking the value of $req_user_level to see if "Guest" is in it?

Karl

On Jan 25, 2010, at 1:32 PM, Peter Beckman wrote:

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@xxxxxxxxxxx http:// www.angryox.com/ ---------------------------------------------------------------------- -----

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Karl DeSaulniers
Design Drumm
http://designdrumm.com


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux