Function Recursion

Tue Oct 28, 2008 12:41 pm

Code:

<html>
<head>
<title>Recursion</title>
</head>
<body>
<?php
     
function cnt_backwards($from) {
          
$from--;
          if(
$from <= 1) {
               print(
$from);
               return;
          }
          print(
$from);
          
cnt_backwards($from);
     }
     
cnt_backwards(5);
?>
</body>
</html>




  Related Posts  to : Function Recursion
 C++ Recursion Sort     -  
 factorial number Using Recursion     -  
 code to find a number all divisors using recursion     -  
 php function     -  
 Using include function     -  
 The isset() Function     -  
 finalize() function     -  
 Function return more than one value     -  
 srand function example     -  
 Nested function     -  

Topic Tags

PHP Functions