in_array()wierdness与$ _POST内的数组 [英] in_array() wierdness with arrays inside of $_POST

查看:102
本文介绍了in_array()wierdness与$ _POST内的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用in_array()搜索一个值(other),以便验证

a表格。

如果我通过$ _POST [" ;兴趣"]作为搜索PHP的数组说它是一个

无效的数据类型。

这是一个数组,如果我把它复制到另一个变量(即$ list) =

$ _POST [" interest"];)它工作正常。

implode()也是如此。


你认为这是故意还是错误?

-

AJ Zmudosky

没有愚蠢的问题,但是有很多好奇的白痴。

解决方案

_POST [" interest"]作为搜索PHP的数组说它是一个

无效的数据类型。

这是一个数组,如果我将它复制到另一个变量(即


list =

_POST [" interest"];)它工作正常。

implode()也是如此。


您认为这是故意还是错误?

-

AJ Zmudosky

没有愚蠢的问题,但是有很多好奇的白痴。


I am using in_array() to search for a value ("other"), in order to validate
a form.
If I pass $_POST["interests"] as the array to search PHP says that it is an
invalid datatype.
It is an array and if I copy it to another variable (i.e. $list =
$_POST["interests"];) it works fine.
The same is also true of implode().

Do you believe this is intended or is it a bug?
--
AJ Zmudosky
There are no stupid questions, but there are a LOT of inquisitive idiots.

解决方案

_POST["interests"] as the array to search PHP says that it is an
invalid datatype.
It is an array and if I copy it to another variable (i.e.


list =


_POST["interests"];) it works fine.
The same is also true of implode().

Do you believe this is intended or is it a bug?
--
AJ Zmudosky
There are no stupid questions, but there are a LOT of inquisitive idiots.


这篇关于in_array()wierdness与$ _POST内的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆