web_monkey7 Posted March 13, 2012 Share Posted March 13, 2012 What does this mean... $controllerAction = isset($_GET['a'])?$_GET['a']:'portal/home'; $controllerAction = trim($controllerAction, "/"); I understand the $_GET part of it, but I have no clue what the "?" before the 2nd $_GET is or what the ":'portal/home'" does together as a whole. Can someone please explain thanks!. I am new to PHP... Quote Link to comment https://forums.phpfreaks.com/topic/258864-unsure-of-code-meaning/ Share on other sites More sharing options...
AyKay47 Posted March 14, 2012 Share Posted March 14, 2012 its called the ternary operator In your example, if $_GET['a'] is set, then $controllerAction will be set to the value of $_GET['a'], else it will be set to "portal/home". Quote Link to comment https://forums.phpfreaks.com/topic/258864-unsure-of-code-meaning/#findComment-1327096 Share on other sites More sharing options...
web_monkey7 Posted March 14, 2012 Author Share Posted March 14, 2012 Ok. I understand now. Thank you so much for the quick reply!! Quote Link to comment https://forums.phpfreaks.com/topic/258864-unsure-of-code-meaning/#findComment-1327101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.