php programs help

I am trying to learn php with the help of tutorials available on internet.
yesterday i was creating a program to print star (*) pyramids like:
a.
*
**




b.




**
*
c.
*
**
***



d.



***
  **
    * 

I have succesfully printed the first two patterns (a and b) but not able to print the other two patterns (using for loop).
please help
thanks in advance

c and d should use the same code, just right align it.

Not so. C and D is not ithe same pattern no matter how you align it. Although, that may hold true for A and C & B & D.

Post your code.

Yeah, that’s a basic programming 101 assignment when you hit loops. Without seeing your code it’s just speculative, but if you can do A and B, it’s the same thing you are just using the wrong symbol in the placement.

Sponsor our Newsletter | Privacy Policy | Terms of Service