Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo $html = generateSelect('Category', array("Action Alert", "Petition"));
- function generateSelect($name = '', $options = array()) {
- $html = '<select name="'.$name.'">';
- foreach ($options as $option => $value) {
- $html .= '<option value='.$option.'>'.$value.'</option>';
- }
- $html .= '</select>';
- return $html;
- }
Add Comment
Please, Sign In to add comment