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... 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". 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!! Link to comment https://forums.phpfreaks.com/topic/258864-unsure-of-code-meaning/#findComment-1327101 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.