public function get_json_list() { $tags = array(); $data = $this->tag_model->get_list($this->input->post('parent'), $this->input->post('id_parent')); // array(id, search_string, Tag displayed string, HTML in Autocomplete) foreach ($data as $tag) { $tags[] = array($tag['id_tag'], strtolower($tag['tag_name']), $tag['tag_name'], $tag['tag_name']); } $this->xhr_output($tags); }