Alex Rivera | Logout

Simple PHP Condition help: if($Var1 = in list($List) and $Cond2) - Is this posslbe?

Asked 2009-05-26T14:28:31.437
14

Is this a possible function?

I need to check if a variable is existent in a list of ones I need to check against and also that cond2 is true eg

if($row['name'] == ("1" || "2" || "3") && $Cond2){
    doThis();
}

It's not working for me and all I changed in the copy paste was my list and the variable names

Edit
Report

1 Answer

0
$name = $row['name'];
if (($name == "1" || $name == "2" || $name == "3") && $cond2)
{
  doThis();
}
answered 2009-05-26T14:31:22.773

Your Answer