spamoom Posted April 12, 2007 Share Posted April 12, 2007 I've seen it before on the forum, but i cant really search for "? :". Is this an alternative soloution to an if statment, and is it correct? $bla = $dog == $cat ? $animal = "horse" : $animal = "mouse"; Thanks Link to comment https://forums.phpfreaks.com/topic/46683-solved-how-does-this-work/ Share on other sites More sharing options...
Orio Posted April 12, 2007 Share Posted April 12, 2007 This is called the ternary operator. See more info here (scroll down a bit). Orio. Link to comment https://forums.phpfreaks.com/topic/46683-solved-how-does-this-work/#findComment-227444 Share on other sites More sharing options...
spamoom Posted April 12, 2007 Author Share Posted April 12, 2007 Thanks Very Much Link to comment https://forums.phpfreaks.com/topic/46683-solved-how-does-this-work/#findComment-227450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.