preg_match "debug" 来自 /new/debug.php

pregmatch "debug" from /new/debug.php

我的 preg_match 真的很糟糕,找不到他们正确的公式来获取 php 页。

我尝试检查页眉,现在用 $_SERVER['REQUEST_URI']

打开哪个页面

可能的变体是索引、调试、登录、注册等

我想切换一下 preg_match 检查的内容,然后切换到打开页面的字段,其中将执行打开的脚本 link.

不用preg_match你也可以这样做:

$url = parse_url($_SERVER['REQUEST_URI']);
$page = basename($url["path"],".php");

switch($page) {
    case "debug":
        // do something
        break;
    // and so on
}