While loop inside while loop

Newbie Member
10Apr2011,09:41   #1
karthickr's Avatar
Hi, I am new to PHP. Can anyone tell me how to use while loop inside while loop?
Go4Expert Founder
10Apr2011,10:55   #2
shabbir's Avatar
Code:
While (SomeCondition)
{
    While (SomeCondition)
    {

    }
}
Go4Expert Member
14May2011,10:30   #3
underground_devil's Avatar
example
PHP Code:
<?php
$i
=1;
while(
$i<5)
      {
          
$j=1
           
while($j<$i)
           {
            echo 
$j." ";
             
$j++;
            }
      echo 
"<br>";
      }
out put would be
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1