Using the ? Operator$mood = "sad";$text = ( $mood=="happy" ) ? "a good mood" : "Not happy but $mood";print "$text";?>