View Problem

Perform different actions depending on a boolean condition (IF .. THEN .. ELSE)

Given a variable age, if the value is greater than 42 display "You are old", otherwise display "You are young"
ExpandDiskEdit
php
if($age < 42) {
echo "You are young";
} else {
echo "You are old";
}
ExpandDiskEdit
php
echo "You are " . (($age < 43) ? "young" : "old");

Submit a new solution for php
There are 33 other solutions in additional languages (clojure, cpp, csharp, erlang ...)