/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getMonthOptions( $selected ) { $options = ''; for( $x = 1; $x < 13; $x++ ) { $options .= '<option value="' . $x . '"'; if( $x == $selected ) { $options .= ' selected="selected"'; } $options .= '>' . $x . '</option>'; } return $options; }