我正在使用多选 Jquery ( http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/ ) 如何在 PHP (Controller) 中检查选择了哪个选项?
这是我在视图中的代码:
<select multiple="multiple" size="5">
<?php
foreach ( $this->restservice->getDepartments() as $department ) {
echo '<optgroup label="' . $department->deptName . '">';
foreach ( $this->restservice->getDepartmentsUsers( $department->deptName ) as $user ) {
echo '<option value="' . $user->{'email'} . '">';
echo $user->{'username'};
echo '</option>';
}
}
echo '</optgroup>';
?>
</select>
PS:我使用 Codeigniter,我更喜欢使用 foreach 并获取所选选项的值。谢谢