Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $n=8;
- $t=50;
- $ar= array(
- "1"=>"1",
- "2"=>"22",
- "3"=>"333",
- "4"=>"4444",
- "5"=>"55555",
- "6"=>"666666",
- "7"=>"7777777",
- "8"=>"88888888",
- "9"=>"999999999", );
- $i=1;
- $sw=false;
- while(1)
- {
- if($i<=$n)
- {
- echo $ar[$i].'<br>';
- $i++;
- }
- else if($i>=$n)
- {
- if($sw==false)
- {
- $n--;
- $i=$n;
- $sw=true;
- }
- else if($sw==true && $n>0)
- {
- echo $ar[--$n].'<br>';
- }
- else
- break;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment