Function with two parameters
<?
function addNums( $num1, $num2 ) {
$result = $num1 + $num2;
$ret = "<table border=\"1\">";
$ret .= "<tr><td>number 1: </td><td>$num1 </td></tr>";
$ret .= "<tr><td>number 2: </td><td>$num2 </td></tr>";
$ret .= "<tr><td>result: </td><td>$result</td></tr>";
$ret .= "</table>";
return $ret;
}
print addNums (49, 60);
?>
Related examples in the same category