Php Laravel数组输入-htmlentities()要求参数1为字符串,数组给定
每当我将具有输入的表单作为数组进行sumbit时,就会出现以下错误 这个问题只有在我提交表单时才会出现 以下是我的输入数组的工作方式:Php Laravel数组输入-htmlentities()要求参数1为字符串,数组给定,php,arrays,laravel-5.2,Php,Arrays,Laravel 5.2,每当我将具有输入的表单作为数组进行sumbit时,就会出现以下错误 这个问题只有在我提交表单时才会出现 以下是我的输入数组的工作方式: 似乎您正在将输入作为数组类型传递。htmlentities()仅适用于字符串类型。 这个 应该是 <td><input type="text" name="type" value="{{ old('type.0') }}" class="form-control"></td> type.0将只返回数组中的第一项。o
似乎您正在将输入作为数组类型传递。htmlentities()仅适用于字符串类型。 这个
应该是
<td><input type="text" name="type" value="{{ old('type.0') }}" class="form-control"></td>
type.0将只返回数组中的第一项。old('type')
是数组,您应该获取它的第一个值,然后手动填充输入。name=“type[]”应该是name=“type”,如果只有一个。如果有多个,则它是一个数组,您应该在提交后处理每个值。
<td><input type="text" name="type" value="{{ old('type.0') }}" class="form-control"></td>