PDA

View Full Version : multiple statements in an if statement


AN-net
04-18-2004, 09:43 PM
like say i want to make it so it checks one variable, sees if someones userid is in this array, or the userid equals this other userid, or if the user is an administrator. i know how to do each separately but how do i do it all in one if statement?

filburt1
04-18-2004, 10:10 PM
like say i want to make it so it checks one variable, sees if someones userid is in this array, or the userid equals this other userid, or if the user is an administrator. i know how to do each separately but how do i do it all in one if statement?

if (in_array($userid, $listOfUserids) or $userid == $otherUserid or is_member_of($arrayWithUseridKey, 6))

Boofo
04-18-2004, 10:11 PM
if (in_array($bbuserinfo['userid'], array(5,6,7)))
{
code you want here
}
elseif ($bbuserinfo['userid'] == '1')
{
code you want here
}
elseif ($bbuserinfo['usergroupid'] == '6')
{
code you want here
}