![]() |
Using an array in an if statement....
I want to know how to use several values, seperated by commas, in an if statement. This is probably very basic, but I need to know. Thanks :)
|
can you be more specific?
|
Say a variable contains this:
Code:
5,6,7,10,56,63 Code:
if ($bbuserinfo[usergroupid]=="5" OR $bbuserinfo[usergroupid]=="6" OR $bbuserinfo[usergroupid]=="7" OR $bbuserinfo[usergroupid]=="10" OR $bbuserinfo[usergroupid]=="56" OR $bbuserinfo[usergroupid]=="63") { Code:
if ($bbuserinfo[usergroupid]==$variable) { |
well this is what i would do...
PHP Code:
|
Link, you should read more of my posts, i use the correct code very often:
PHP Code:
|
That's what it is. I just didn't remember it becuase I haven't had any need for it until now. ;)
Thanks. :) |
i'll have to remember that :D
|
In forumdisplay.php, I have this code:
PHP Code:
Furthermore, if the variable $allowusercreateprivate is set to 1, I want it to get all of that user's threads even if visible!=1. Any ideas on that? |
try this
PHP Code:
|
Nope...
Code:
Warning: Wrong datatype for second argument in call to in_array() in /home/sites/site68/web/forums/forumdisplay.php on line 493 |
oh well, i didn't now how those if querys work anyways, just a stab in the dark :D
|
link it seems $privateusergroupable is not an array but a string..., instead of that:
PHP Code:
PHP Code:
|
Sorry to jump on this thread but how would I alter this
PHP Code:
PHP Code:
|
its this:
PHP Code:
|
Worked a treat. Thanks once again Xenon.
|
All times are GMT. The time now is 10:54 AM. |
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:
|