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