Codeigniter - 输入post方法是从多选字段中删除或清空发布数据

I am using Codeigniter 3.0.0 version

When trying access the value of a multi select drop down field named as subjecID[ ] using $this->input->post() method,it returning empty value. But When I am accessing the $_POST['subjectID'] I can see the value in the form of an array from the subjecID[ ] field. Even In older version of Codeigniter I was able to get the data as an array from the post. So, what might be the issue. Please tell me if is there any configurations to change?

Below is my controller function.

protected function rules() {
    $rules = array(
        array(
            'field' => 'name',
            'label' => $this->lang->line("teacher_name"),
            'rules' => 'trim|required|max_length[60]'
        ),
        array(
            'field' => 'subjectID',
            'label' => $this->lang->line("select_subject"),
            'rules' => 'required'
        )
    );
    return $rules;
}

public function add() {
            $this->data['subjects'] = $this->subject_create_m->get_subject();
    if($_POST) {
        $rules = $this->rules();
        $this->form_validation->set_rules($rules);
        if ($this->form_validation->run() == FALSE) {
            $this->data['form_validation'] = validation_errors();
            $this->data["subview"] = "teacher/add";
            $this->load->view('_layout_main', $this->data);
        } else {
            $array = array();
            $array['name'] = $this->input->post("name");
            $array['specialization'] = serialize($this->input->post('subjectID[]'));
            print_r($array);
        }
    } else {
        $this->data["subview"] = "teacher/add";
        $this->load->view('_layout_main', $this->data);
    }

}

Below is the Output I am getting by printing the post using the following code

print_r($this->input->post(NULL, FALSE));

Array ( [name] => sfgfdsgfsd [subjectID] => )

Because of this issue every time the validation is failing.

try this 'field' => 'subjectID[]' instead of 'field' => 'subjectID' in the validation rules

try this one

$this->input->post('subjects[]');

check helper in configuration

$autoload['helper'] = array('form');

i have just recently use multiple input type array its working use $this->input->post('subjects');

You can get array of selected values using

$this->input->post('subjects');

Or you use php post variable to get data

if(isset($_POST[subjects])){
foreach($_POST[subjects]) as $subject){

}
}

Best is post your form html code here so that proper answer can be posted

use var_dump($this->input->post()) Or Did you remove index.php from url