Using the ? Operator
|
<html> <head> <title>Using the ? Operator</title> </head> <body> <?php $mood = "sad"; $text = ( $mood=="happy" ) ? "a good mood" : "Not happy but $mood"; print "$text"; ?> </body> </html>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
|