jrahma;11034723 wrote:sorry I will explain again...
you'll see the top of the starting from 1950 so user needs to scroll down to get the current year.
what I want is the reverse.. so the current year will be at the top of the list
We understand the question. Weedpacket is trying to help you understand the solution.
What your loop does now:
- Start in 1950
- Stop in the current year
- Each turn, add 1.
These three instructions map directly to the three statements in the [font=monospace]for[/font] loop. Observe:
for( {start with 1950}; {stop in {current year}}; {each turn, add 1} ){}
for( $i = 1950; $i <= date( 'Y' ); $i++ ){}
So, describe what you want you loop to do in those same terms...
- Start in the current year
- Stop in 1950
- Each turn, subtract 1.
...and give the code a try.