前言
截取http://sy.66969.cn/sh.html中的sh怎么做?
1、使用步骤
1.引入代码
//它的作用是从给定的 URL 中提取文件名,并去除文件扩展名 ".html"。 $url = $_SERVER['REQUEST_URI'];//获取道/sh.html $segment = basename($url, ".html"); print_r($segment);exit();
2.效果
总结
写好了,谢谢大家.
截取http://sy.66969.cn/sh.html中的sh怎么做?
//它的作用是从给定的 URL 中提取文件名,并去除文件扩展名 ".html"。 $url = $_SERVER['REQUEST_URI'];//获取道/sh.html $segment = basename($url, ".html"); print_r($segment);exit();
写好了,谢谢大家.