Posted By

frederick on 07/10/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jackkeller


cssvar-loop


 / Published in: PHP
 

  1.  
  2. <?
  3. $selector = 'ul';
  4.  
  5. for($i=1;$i<11;$i++) {
  6.  
  7. echo str_repeat('ul ', $i);
  8.  
  9. if ($i % 2 != 0) {
  10. echo "{background-color:green;width:100%;height:20px;display:block;float:left;}\n\n";
  11. } else {
  12. echo "{ background-color:blue;width:80%;height:20px;display:block;float:left;}\n\n";
  13. }
  14.  
  15. }
  16.  
  17. ?>

Report this snippet  

You need to login to post a comment.