Re: [PHP4BETA] recursive functions?
| From: | Lloyd Zusman | Date: | Wed, 03 May 2000 00:47:52 +0000 |
| Subject: | Re: [PHP4BETA] recursive functions? | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14398@lists.php.net to get a copy of this message | ||
Michael Stearne <mstearne@entermix.com> writes:
> That's not recursive anyway. A recursive function calls itself.
>
> Michael
It's true that neither function itself is called "a recursive
function", but the interaction of the two functions is indeed a
proper, textbook example of recursion.
> Gernot Schabkar wrote:
>
> > 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
>
>
> --
> 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
>
>
--
Lloyd Zusman
ljz@asfast.com