![]() |
What is wrong with my PHP?
if ($bbuserinfo[usergroupid != 5 OR $bbuserinfo[usergroupid != 6)
This IF statement is not working. What is wrong? |
You forgot the last bracket on $bbuserinfo[usergroupid].
|
You might also want to encompass each side of the expression in a container.
if (($bbuserinfo[usergroupid] != 5) OR ($bbuserinfo[usergroupid] != 6)) |
Moved to the correct forum :)
|
also it's easier to use the in_array for such things:
PHP Code:
i assume you need an and ;) |
and also, i beleive you should be using || instead of OR
AND and OR are bitwise operators. If you dont know what those are, you should probably avoid them altogether use && instead of AND use || instead of OR |
Quote:
Somthing about the boolean logic is bad. |
Quote:
from: http://www.vbulletin.com/docs/html/codestandards |
Quote:
|
bit wise operators are & and |
&& and || as well as AND and OR are boolean operators in PHP using AND/OR in conditions and &/| for bitwise ops makes the code more readable, that's why i defined AND/OR as macros in my C++ as well :) |
All times are GMT. The time now is 09:58 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|