Fatal error when calling nested function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's the list :

<?php
function salestax($price,$tax) {
function convert_pound($dollars, $conversion=1.6) {
return $dollars * $conversion;
}
$total = $price + ($price * $tax);
echo "Total cost in dollars: $total. Cost in British pounds: "
.convert_pound($total);
}
echo convert_pound(15);
?>

I get the following error :

*Fatal error*: Call to undefined function convert_pound() in
...*Untitled-1.php* on line *18

*line 18 is this one : echo convert_pound(15);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux