Mutley Posted April 25, 2007 Share Posted April 25, 2007 When using variables, what does ? and : relate to, what are they? Such as: $a = '1'; ($a == 0) ? true : false; Quote Link to comment Share on other sites More sharing options...
otuatail Posted April 25, 2007 Share Posted April 25, 2007 X = ($a == 0) ? true : false; if $a = 0 answer = true else it is false Quote Link to comment Share on other sites More sharing options...
per1os Posted April 25, 2007 Share Posted April 25, 2007 The ? is called the ternary operator. The : is kind of like else. Quote Link to comment Share on other sites More sharing options...
gzipp Posted April 25, 2007 Share Posted April 25, 2007 ? and : together form the ternary operator. Know what you're talking about. Quote Link to comment 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.