lban1 Posted February 13, 2011 Share Posted February 13, 2011 Hello everyone, Can somebody help me? I am a novice in PHP programming. I do not understand a line of code below: $action = isset($_GET['action']) ? $_GET['action'] : ''; The variables $action saves the values obtained by the GET method, but what does this piece of code ? $_GET['action'] : ''; Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/227538-explanation-of-codes/ Share on other sites More sharing options...
Jessica Posted February 13, 2011 Share Posted February 13, 2011 It's called a ternary operator. it's in the place of "if else". Link to comment https://forums.phpfreaks.com/topic/227538-explanation-of-codes/#findComment-1173699 Share on other sites More sharing options...
Pikachu2000 Posted February 13, 2011 Share Posted February 13, 2011 That is the ternary operator. See example #2 HERE. Link to comment https://forums.phpfreaks.com/topic/227538-explanation-of-codes/#findComment-1173701 Share on other sites More sharing options...
lban1 Posted February 13, 2011 Author Share Posted February 13, 2011 Thank you for responding so quickly, you have helped me a lot Link to comment https://forums.phpfreaks.com/topic/227538-explanation-of-codes/#findComment-1173718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.