Easy way to shorten conditionals?
Posted: Mon Jan 10, 2011 7:00 am
Does anyone know if there's an easy way to shorten conditionals?
For example, is there a way of rewriting this to make it shorter?
I'm guessing that PHP might have a nifty way of returning true if _SESSION['userClassName'] is either 'admin' or 'superuser'.
Thanks
For example, is there a way of rewriting this to make it shorter?
Code: Select all
if ($_SESSION['userClassName'] == "admin" || $_SESSION['userClassName'] == "superuser")Thanks