Previous | Home | Next |
<html> <head> <title> Nesting Function</title> </head> <body> <?php function myFunction($p,$t) { function convert_pound($d, $c=1.9) { return $d * $c; } $total = $p + ($p * $t); echo "Total cost in d: $total. Cost in British pounds: " . convert_pound($total); } myFunction(18.00,.090); echo convert_pound(18); ?> </body> </html>
Output:
Previous | Home | Next |