recursive functions?
| From: | Gernot Schabkar | Date: | Tue, 02 May 2000 23:41:23 +0000 |
| Subject: | recursive functions? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14395@lists.php.net to get a copy of this message | ||
is it somehow possible to realize a recursive program like that with php?
<?
function print1($txt) {
if ($txt!="") {
echo substr($txt,0,1);
print2(substr($txt,1));
}
}
function print2($txt) {
if ($txt!="") {
echo substr($txt,0,1);
print1(substr($txt,1));
}
}
print2("test");
?>
that should produce :
test
if there is a trick to manage it, then a hint would be very welcome!