Source Code:
(back to article)
<?php // Example 1 function addNumbers($a, $b) { return $a + $b; } $result = addNumbers(2, 3); echo $result . PHP_EOL; // Example 2 function isPositive($num) { if ($num > 0) { return true; } else { return false; } } if (isPositive(5)) { echo "The number is positive"; } else { echo "The number is negative"; }
Result:
Report an issue