MyBB Community Forums
Multiple units in if statement - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Multiple units in if statement (/thread-207112.html)



Multiple units in if statement - http:// - 2017-01-03

Straight forward,

<if $post['usergroup'] == 4 then>

I need more usergroups to be effected by this if statement. Like usergroup 21 and 69 for an example. How to add more than one usergroup?

Thanks o/


RE: Multiple units in if statement - Matt - 2017-01-03

You can probably do:

 <if in_array($post['usergroup'], array(4,21,69)) then>

I don't use the PHP conditionals plugin but have seen in the past it allows regular PHP functions so give it a go Smile