<?php
function is_divisible_by_1($num) {
echo "<p>Of course $num is divisible by 1, everything is!</p>";
}
function is_divisible_by_2($num) {
if ($num % 2 == 0) {
echo "<p>$num is divisible by 2. That means it is even.</p>";
}
}
function is_divisible_by_3($num) {
if ($num % 3 == 0) {
echo "<p>$num is divisible by 3.</p>";
}
}
function is_divisible_by_4($num) {
if ($num % 4 == 0) {
echo "<p>$num is divisible by 4. It is double-even!</p>";
}
}
function is_divisible_by_5($num) {
if ($num % 5 == 0) {
echo "<p>$num is divisible by 5. It ends in a 0 or a 5.</p>";
}
}
for ($i = 5; $i > 0; $i--) {
$var = 'is_divisible_by_' . $i;
$var(2000);
}
?>
|