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

Function Recursion

Tue Oct 28, 2008 1: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>




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

Topic Tags

PHP Functions