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     -  
 Function Recursion     -  
 function key recognition     -  
 Function return more than one value     -  
 Using the array_slice () Function     -  
 array_key_exists function use     -  

Topic Tags

PHP Functions