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; Link to comment https://forums.phpfreaks.com/topic/48539-and/ 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 Link to comment https://forums.phpfreaks.com/topic/48539-and/#findComment-237618 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. Link to comment https://forums.phpfreaks.com/topic/48539-and/#findComment-237621 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. Link to comment https://forums.phpfreaks.com/topic/48539-and/#findComment-237635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.