Guest User

Untitled

a guest
Jul 11th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. for($i=2011; $i<=(int)date('Y'); $i++)
  2. {
  3.     $year_list[] = $i;
  4. }
  5.  
  6. $n = count($year_list)-1;
  7.  
  8. $javascript2 = 'onchange="document.adminForm.submit();"';
  9. $attribs = 'class="inputbox" size="1" '. $javascript2;
  10.  
  11. //$options[] = JHTML::_( 'select.option', '', JText::_( 'AUP_SELECTYEAR' ) );
  12.  
  13. for ($i=0, $n=(count( $year_list )-1); $i <= $n; $i++) {
  14.     $options[] = JHTML::_( 'select.option', $year_list[$i], $year_list[$i] );
  15. }
  16.  
  17.  
  18. some notes:
  19. the first $n = is overriden
  20. wtf is that $n = assign inside the foor loop
  21.  
  22. why not just assign the $options[] inside the first for loop instead of creating year_list .
Add Comment
Please, Sign In to add comment