AW: [PHP4BETA] recursive functions?
| From: | Gernot Schabkar | Date: | Tue, 02 May 2000 23:55:21 +0000 |
| Subject: | AW: [PHP4BETA] recursive functions? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14396@lists.php.net to get a copy of this message | ||
sorry for the silly request, its working anyway.
got some other mistake in my code!
-----Ursprüngliche Nachricht-----
Von: Gernot Schabkar [mailto:g.schabkar@nsi.at]
Gesendet: Mittwoch, 3. Mai 2000 01:41
An: php4beta@lists.php.net
Betreff: [PHP4BETA] recursive functions?
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!
--
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
For additional commands, e-mail: php4beta-help@lists.php.net
To contact the list administrators, e-mail: php4beta-admin@lists.php.net