我有这段代码
redirect_loc(index.php);
这个函数的定义在函数文件的某个地方。
function redirect_loc($location=NULL)
{
if($location!=NULL)
{
header("Location:$location");
exit;
}
}
当我传递“index.php”(注意引号以指定为字符串)时,它可以工作,但是传递 index.php 会给出错误在此服务器上找不到请求的 URL /indexphp。
当它不作为字符串传递时,为什么这不起作用?