Warning:in_array() [function.in-array]:Wrong datatype for second argument in D:\wa...on line 12$filelist=array("muban","login","check");function filename(){$dir=basename($_SERVER['REQUEST_URI'],".php");if(in_array("$dir",$filelist,TRUE)) //第12行re

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 15:05:17
Warning:in_array()[function.in-array]:WrongdatatypeforsecondargumentinD:\wa...online12$filelist=arra

Warning:in_array() [function.in-array]:Wrong datatype for second argument in D:\wa...on line 12$filelist=array("muban","login","check");function filename(){$dir=basename($_SERVER['REQUEST_URI'],".php");if(in_array("$dir",$filelist,TRUE)) //第12行re
Warning:in_array() [function.in-array]:Wrong datatype for second argument in D:\wa...on line 12
$filelist=array("muban","login","check");
function filename()
{
$dir=basename($_SERVER['REQUEST_URI'],".php");
if(in_array("$dir",$filelist,TRUE)) //第12行
return $dir;
}

Warning:in_array() [function.in-array]:Wrong datatype for second argument in D:\wa...on line 12$filelist=array("muban","login","check");function filename(){$dir=basename($_SERVER['REQUEST_URI'],".php");if(in_array("$dir",$filelist,TRUE)) //第12行re

不能把in_array这个函数放到function里面

$filelist=array("muban","login","check");

$dir=basename($_SERVER['REQUEST_URI'],".php");
if(in_array($dir,$filelist, TRUE))   
echo $dir;
这样修改即可