Function Recursion Demo : Function Recursion : Functions PHP Source Code


PHP Source Code » Functions » Function Recursion »

 

Function Recursion Demo



<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>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Functions
» Function Recursion