如何在包含路径的末尾使用带有GET参数的php include()?
IE:
include("/home/site/public_html/script.php?id=5");
Run Code Online (Sandbox Code Playgroud)
如何在包含路径的末尾使用带有GET参数的php include()?
你可以写到$_GET:
$_GET["id"] = 5; // Don't do this at home!
include(".....");
Run Code Online (Sandbox Code Playgroud)
但这感觉很糟糕和错误.如果可能的话,使包含的文件接受正常变量:
$id = 5;
include("....."); // included file handles `$id`
Run Code Online (Sandbox Code Playgroud)