Example #1
0
<?php

require_once 'ja.php';
writeHello();
writeMsg('hello');
writeMsg('okdoei');
writeMsgTo('Robin', 'ja');
writeMsgTo('Robin');
$outcome = addValue(5, 7);
echo 'The outcome of 5+7 = ' . $outcome . '<br/>';
$outcome = calcRect(5, 7);
echo 'The area of a rectangle of 5 and 7 is ' . $outcome . '<br/>';
BMI();
Example #2
0
<?php

include 'functions.php';
writeHello();
writeMsg('hello');
writeMsg('byebye');
writeMsgTo('Cemre', 'Function are cool!');
writeMsgTo('Henk');
$result = numbers(5, 7);
echo 'The outcome of 5 + 7 = ' . $result . '<br/>';
$result = calcRect(5, 7);
echo 'The area of a rectangle of 5 and 7 =' . $result . '<br/>';
?>

<br>
Exercise 2 BMI:
<form action="bmicalculator.php" method="post">
Lengte in M : <input type="text" name="lengte"></input>
Gewicht in kg : <input type="text" name="gewicht"></input>
<input type="submit" value="Bereken BMI"></input>
</form>

//$bmi = weight / (height * height);