function yearDropdownMenu($start_year, $end_year = null, $id='year_select', $selected=null) {
    $end_year = is_null($end_year) ? date('Y') : $end_year;
    $selected = is_null($selected) ? date('Y') : $selected;

    $r = range($start_year, $end_year);

    $select = '<select name="'.$id.'" id="'.$id.'">';

    foreach($r as $year){
        $select .= "<option value=\"$year\"";
        $select .= ($year==$selected) ? ' selected="selected"' : '';
        $select .= ">$year</option>\n";
    }

    $select .= '</select>';

    return $select;
}

Örnek Kullanım:

echo yearDropdownMenu(1987);