How can I get the value of a multiple select input field in CodeIgniter controller?
I want a multiple select input field shown here
I have added below html code.
<select class="js-example-basic-multiple multiple_selection form-control" name="student[]" multiple="multiple" >
<option value="1">Student1</option>
<option value="2">Student2</option>
<option value="3">Student3</option>
<option value="4">Student4</option>
<option value="5">Student5</option>
<option value="6">Student6</option>
</select>
I am using given code to fetch the value of this input field. But I didn't get the value.
$studentname = array();
$studentname =$this->input->post('student[]');
echo 'studentName:'.$studentname;
Do you have any suggestions?