Jump to content

problem with loop


felito

Recommended Posts

hi

 

The output of this code is:

 

    1950

    1951

    1952

    ....

 

script

 

     <?php 
        for ($i = 1950; $i < 2012; $i++) {
        echo "<option value='$i' class='dr'>".$i.'</option>';
        }
        ?>

 

but i need something like:

 

    Insert a date

    1950

    1951

    1952

    ....

 

how can i solve that?

 

welll. i can do

 

<option value='null' class='dr'> year</option>

Link to comment
https://forums.phpfreaks.com/topic/238002-problem-with-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.