Untitled
unknown
plain_text
3 years ago
589 B
9
Indexable
<?php
// If statement example
$num = 10;
if ($num > 0) {
echo "The number is positive.";
}
// If-else statement example
$num = -5;
if ($num > 0) {
echo "The number is positive.";
} else {
echo "The number is not positive.";
}
// Switch statement example
$day = "Tuesday";
switch ($day) {
case "Monday":
echo "Today is Monday.";
break;
case "Tuesday":
echo "Today is Tuesday.";
break;
case "Wednesday":
echo "Today is Wednesday.";
break;
default:
echo "Today is not Monday, Tuesday, or Wednesday.";
}
?>
Editor is loading...