GingerRobot Posted July 17, 2006 Share Posted July 17, 2006 I cant find the short way of doing if statments using the ? and :Does anyone know what it is? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/14827-short-syntax-for-if-statments/ Share on other sites More sharing options...
wildteen88 Posted July 17, 2006 Share Posted July 17, 2006 ? and : are called ternary conditional operators Quote Link to comment https://forums.phpfreaks.com/topic/14827-short-syntax-for-if-statments/#findComment-59249 Share on other sites More sharing options...
GingerRobot Posted July 17, 2006 Author Share Posted July 17, 2006 Ok, thanks. I got what i was looking for:($var == 1) ? "yes" : "no"; Quote Link to comment https://forums.phpfreaks.com/topic/14827-short-syntax-for-if-statments/#findComment-59250 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.