php - Can I get a form_multiselect() to return the values I pass in rather than indexes? -
i have form_multiselect() perform search on items associated tags. form: <div class="control-group"> <?= form_label('tags: ', 'tag', $label_attr);?> <div class="controls"> <?= form_multiselect('tag[]',$tags,'','id="tag-select"');?> </div> </div> i fill form get_tags() model: public function get_tags() { $this->db->select('tag_name'); $this->db->distinct(); $this->db->from('offers_tags'); $query = $this->db->get(); $results = $query->result_array(); $tags_arr= array(); $i = 0; foreach ($results $id => $tag_name){ foreach ($tag_name $name){ $tags_arr[$i] = $name; ++$i; } } return $tags_arr; } i loop through associative $results array returned query. if not, form filled indexes , associated arrays, when w...