tripper Posted February 22, 2007 Share Posted February 22, 2007 what does '?' do. I know it checks for true or false but are there any examples in tutorials that show what it does. Like i have this example ($last_page_number!="0"?", $last_page_number manuscript pages":"") but i wont get it once i see an example of done in a tutorial or something Thanks Link to comment https://forums.phpfreaks.com/topic/39687-how-to-use/ Share on other sites More sharing options...
JasonLewis Posted February 22, 2007 Share Posted February 22, 2007 basiclly its like a mini if statement. here is an example: $foo = "foo"; echo $foo == "foo" ? "Foo is equal to foo" : "Foo is not equal to foo"; Link to comment https://forums.phpfreaks.com/topic/39687-how-to-use/#findComment-191587 Share on other sites More sharing options...
effigy Posted February 22, 2007 Share Posted February 22, 2007 See "Ternary Operator" here. Link to comment https://forums.phpfreaks.com/topic/39687-how-to-use/#findComment-191588 Share on other sites More sharing options...
joder Posted February 22, 2007 Share Posted February 22, 2007 http://us2.php.net/manual/en/control-structures.alternative-syntax.php Link to comment https://forums.phpfreaks.com/topic/39687-how-to-use/#findComment-191589 Share on other sites More sharing options...
tripper Posted February 22, 2007 Author Share Posted February 22, 2007 ok cool. Thanks alot guys Link to comment https://forums.phpfreaks.com/topic/39687-how-to-use/#findComment-191590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.