Simple code of php for making tree using asterisk
It is easy to make tree using php in less no. of line of code. Here are few line of code that will help you to get desired output by using for loop with three variable i,j and k or this can be explained by using the nested for function or it can be possible by using while function also. Below the code there is an output showing which is the result of above code. Try this code to your system it will help you to design the tree.
</php
for($i=0;$i<9;$i++)
{
for ($j=1;$j<9-$i;$j++)
{
echo"  ";
}
for ($k=0; $k<(2*$i-1); $k++)
{
echo " * ";
}
echo "<br>";
}
/>
Output:-
*
* * *
* * * * *
0 Comment(s)