Published in: PHP
function getDayOptions( $selected ) { $options = ''; for( $x = 1; $x < 32; $x++ ) { $options .= '<option value="' . $x . '"'; if( $x == $selected ) { $options .= ' selected="selected"'; } $options .= '>' . $x . '</option>'; } return $options; }
Comments
Subscribe to comments
You need to login to post a comment.

You were looking for this;
In fact some further use of sprintf it reduces to