Posted by Jon Slaughter on 05/04/07 04:24
"Mohawk Moak" <blessblessbless@gmail.com> wrote in message
news:1178249760.084436.255930@c35g2000hsg.googlegroups.com...
> this method worked good, i did not realize to set the global twice.
> the reason to set the counter to 0 in the end is so that the function
> is usable more than 10 times (or whatever limit it is)
> thanks for pointing out that it was in the wrong row though xD
> probably would not have figuered that one out so fast
> bless
>
Yeah. See Normans post about static variables. Normally this is what you use
but I didn't know if php had it(though that is what global was).
If you get a program like zend studio then you can debug your code and step
through it one line at a time and see whats going on. This is how I found
out that your counter was local and not actually counting the recursive
steps. It makes it much easier to write code if you can debug it.
Jon
Navigation:
[Reply to this message]
|