range() error
Posted: Thu May 19, 2011 9:48 pm
Code: Select all
range(2010,2012);
been searching and i cant find a solution for this..ErrorException range() step exceeds the specified range
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
range(2010,2012);
been searching and i cant find a solution for this..ErrorException range() step exceeds the specified range
nope.. it is from the range function..McInfo wrote:The range() function does not throw exceptions, so the message must come from a different part of your code.
Code: Select all
22 $selected = is_null($selected) ? date('Y') : $selected;
23
24 /*** create the select ***/
25 $select = '<select name="'.$id.'" id="'.$id.'">';
26 //for( $year=$start_year;$year<=$end_year;$year++ )
27 foreach(range($start_year,$end_year) as $year)
28 {
29 $select .= "<option value=\"$year\"";
30 $select .= ($year==$selected) ? ' selected="selected"' : '';
31 $select .= ">$year</option>\n";
32 }