Axcelcius Posted December 6, 2007 Share Posted December 6, 2007 I just need to know the purpose and how to structure the '?' and ':' in PHP. I have run across a few functions that utilize them in what looks to be IF ELSE statements but I don't quite understand how to use them. Link to comment https://forums.phpfreaks.com/topic/80499-solved-stupid-question-simple-answer/ Share on other sites More sharing options...
Orio Posted December 6, 2007 Share Posted December 6, 2007 You are talking about the ternary operator... Check the manual about it: http://www.php.net/operators.comparison (Scroll down a bit) Orio. Link to comment https://forums.phpfreaks.com/topic/80499-solved-stupid-question-simple-answer/#findComment-408099 Share on other sites More sharing options...
PHP_PhREEEk Posted December 6, 2007 Share Posted December 6, 2007 Don't go crazy with them... they are helpful in certain places, but not many. While it seems to condense the code, it also makes it a major PITA to trouble shoot the code if the code is littered with these things. You should fully write out your IF logic... PhREEEk Link to comment https://forums.phpfreaks.com/topic/80499-solved-stupid-question-simple-answer/#findComment-408141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.