Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Nested function

Tue Oct 28, 2008 1:43 pm

Code:
<?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);
   }

salestax(15.00,.075);
echo
convert_pound(15);

?>




Post a reply
  Related Posts  to : Nested function
 nested ordered list     -  
 Break in Nested Loops     -  
 Layout with Nested JPanels     -  
 Nested classes(inner class) in java     -  
 php function     -  
 The isset() Function     -  
 finalize() function     -  
 srand function example     -  
 Function Recursion     -  
 function key recognition     -  

Topic Tags

PHP Functions