首页 > 代码库 > Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 26

Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 26

同样是PHP版本问题:in_array()函数 第二个参数应该为数组

但是 lnmp下,PHP5.3不报错,wamp下PHP5.5报以下错误:

echo "<br>For in_array:";
$arrstr="weibhd1";
if(in_array("weibhd1",$arrstr))
{
    echo "ok!";
}else{
   echo "no!";
}

( ! ) Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 114

Call Stack

#

Time

Memory

Function

Location

1

0.0010

147376

{main}( )

..\suiji.php:0

2

0.0060

170912

in_array ( )

..\suiji.php:114

array!

Warning: in_array() expects parameter 2 to be array, string given in D:\wamp\www\suiji.php on line 26