拉拉维尔刀片中多选选项中的旧值
这是我的选择选项
<select name="recomemded_food[]" value="" style="width:560px;" multiple class="chosen-select" >
<option value="American Black Bear">American Black Bear</option>
<option value="Asiatic Black Bear">Asiatic Black Bear</option>
<option value="Brown Bear">Brown Bear</option>
<option value="Giant Panda">Giant Panda</option>
</select>
下面是我尝试使用 foreach 循环来获取数组值的代码。但是我收到以下错误:
@foreach (explode(',',old('recomemded_food')) as $recomemded_food)
{{$recomemded_food}}
@endforeach
错误消息:explode() 期望参数 2 为字符串