Nodral Posted May 25, 2011 Share Posted May 25, 2011 Hi Guys I've absolutely no knowledge of OOP and I've inherited a huge site built with OOP. I can convert some of it, to variables I understand and can use, and have a vague understanding of the predefined functions. However I an struggling to put a simple if/or statement together. if(user_has_role_assignment($USER->id,1)){ works fine, but when I try to do it as an if / or it fails. if(user_has_role_assignment($USER->id,1)) || ($USER->id,36)) { Any ideas? Sorry, I don't have any errors as another part of the site turns off the error reporting and I can't for the life of me turn it back on with error_reporting(E_ALL) in the page; Link to comment https://forums.phpfreaks.com/topic/237429-oop-if-or-statement/ Share on other sites More sharing options...
KevinM1 Posted May 25, 2011 Share Posted May 25, 2011 If-conditional statements work exactly the same in OOP as they do 'normally'. You need to check the entire thing twice, like so: if(user_has_role_assignment($USER->id, 1) || user_has_role_assignment($USER->id, 36)) { // do stuff } Link to comment https://forums.phpfreaks.com/topic/237429-oop-if-or-statement/#findComment-1220005 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.