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. 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 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"; 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
Archived
This topic is now archived and is closed to further replies.