所以,我有$dp->isi = "1,2,3,4"
<select name="isi[]" class="form-control select2" multiple="multiple" data-placeholder="Choose"
style="width: 100%;">
<?php foreach ($data->result() as $db) : ?>
<option value="<?php echo $db->id;?>"
<?php if ($db->id == explode(',',$dp->isi)) { ?>
selected="selected"<?php } ?>>
<?php echo $db->name; ?>
</option>
<?php endforeach; ?>
</select>
使用codeIgniter,我希望在multiselect上选择$dp->isi
值。