![](/img/trans.png)
[英]Laravel 5.4: How do I validate an array of file inputs with the same name?
[英]Validate inputs with the same name recieved htmlspecialchars() error raised
我有一个具有多个输入的表单,其名称如下:
.... OTHER INPUTS BIENG VALIDATED ....
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="lastname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="latname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
.... OTHER INPUTS BIENG VALIDATED ....
我需要提一下,给我错误的输入是上面列出的,它们没有得到验证。
错误如下:
htmlspecialchars() 期望参数 1 是字符串,给定数组
其名称最后包含[]
的输入会向服务器发送一个数组。 您不能将数组传递给 htmlspecialchars(),因为它不包括字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.