need help abt PHP on very basic steps

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fiza
Forum Newbie
Posts: 5
Joined: Sun Aug 23, 2009 12:13 pm

need help abt PHP on very basic steps

Post by fiza »

Hi All
this is fiza
new 2 this forum
nd just started my developmnt career
bt stil having lots of quries
hop u guize vil help me
im learing php wid tuorials aswell
bt didnt get the logics
like in nested loop i hv example
i want print like this..nd i used following statmnt
* * * * *
* * * *
* * *
**
*
<?php
for($x=0; $x<=10; $x++);
for($y=0; $y<=10; $y++);
echo "*"
?>

so kindly help me abt this statment..
nd also tel me how i can clear my logics regarding PHP

tnx
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: need help abt PHP on very basic steps

Post by Mark Baker »

Code: Select all

 
for($x=5; $x>0; $x--) {
   for($y=1; $y<=$x; $y++) {
      echo '*';
   }
   echo '<br />';
}
 
or

Code: Select all

 
for($x=5; $x>0; $x--) {
   echo str_repeat('*',$x).'<br />';
}
 
Post Reply