Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel数组输入-htmlentities()要求参数1为字符串,数组给定_Php_Arrays_Laravel 5.2 - Fatal编程技术网

Php Laravel数组输入-htmlentities()要求参数1为字符串,数组给定

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

每当我将具有输入的表单作为数组进行sumbit时,就会出现以下错误

这个问题只有在我提交表单时才会出现

以下是我的输入数组的工作方式:


似乎您正在将输入作为数组类型传递。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>