A
Anonymous
Guest
I come to web programming from an extensive background in client side C++ programming. Im used to recursion in alot of my previous programs and was wondering if PHP supports such a concept. I had tried a simple script and it didnt work as I anticipated. Take this for instance:
Now, in C++ that would have displayed that line 10 times decending to 0. I tried it in PHP and it only displays the one line ( the number 10 ). Am I going about this wrong or is this just not supported?
Thanks for the input.
Will
Code:
function display_tree($temp)
{
if ( $temp < 10 )
display_tree($temp+1);
else
echo "display_tree($temp);\n<br>";
}
display_tree(0);
Now, in C++ that would have displayed that line 10 times decending to 0. I tried it in PHP and it only displays the one line ( the number 10 ). Am I going about this wrong or is this just not supported?
Thanks for the input.
Will