function isEven($getal1) { $getal1 % 2 == 0 ? $bool = true : ($bool = false); return $bool; } //*********************************** DEEL 2 ******************************* ?> <!DOCTYPE html> <html> <head></head> <body> <h1>DEEL 1</h1> <p><?php echo berekenSom(4, 7); ?> </p> <p><?php echo berekenProduct(4, 7); ?> </p> <p><?php echo isEven(4); ?> </p> </body> </html>
$testGetal1 = 5; $testGetal2 = 10; $testString = 'alsdkfj'; function berekenSom($getal1, $getal2) { $som = $getal1 + $getal2; return $som; } $berekenSomResult = berekenSom($testGetal1, $testGetal2); function berekenProduct($getal1, $getal2) { $product = $getal1 * $getal2; return $product; } $berekenProductResult = berekenProduct($testGetal1, $testGetal2); function isEven($getal) { if ($getal % 2 === 0) { $result = TRUE; } else { $result = FALSE; $result = (int) $result; } return $result; } $isEvenResult = isEven($testGetal1); function stringToUpperLength($string) { $stringToUpper = strtoupper($string); $stringLength = strlen($string);