Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Traditional
- if ($cake == "fresh")
- {
- print "Yum yum! This cake is tasty.";
- }
- else
- {
- print "Yuck! This cake tastes awful!";
- }
- //Ternary
- This can be rewritten as the following ternary statement:
- print ($cake == "fresh") ? "Yum yum! This cake is tasty." : "Yuck! This cake tastes awful!";
Add Comment
Please, Sign In to add comment