I have this function
public function year() {
$years = array_merge_recursive(
array('' => 'Please Select'),
array_combine(range(date("Y"), 1945), range(date("Y"), 1945))
);
return $years;
}
And on my controller I send to view like
$this->data['byear'] = $this->birthday->year();
if ($this->input->post('bd3')) {
$this->data['bd3'] = $this->input->post('bd3');
} else {
$this->data['bd3'] = '';
}
$this->data['children'] = array(
'common/header',
'common/footer',
'common/navbar'
);
$this->load->render('account/register', $this->data);
And then on the view
<?php echo form_dropdown('bd3', $byear, $bd3, array('class' => 'form-control', 'id' => 'birthday'));?>
How ever the option value on view displays numbers from 1 to 72 which is wrong.
Question How can I make sure the option value displays the YEARS?