$paths = explode('/', trim($_SERVER['PATH_INFO'], '/'));
$mark = count($paths) > 2 ? end($paths) : null;
本文探讨了PHP中如何通过$_SERVER['PATH_INFO']获取并解析URL路径信息,利用explode函数分割路径,判断路径深度并获取最后一个路径段。
$paths = explode('/', trim($_SERVER['PATH_INFO'], '/'));
$mark = count($paths) > 2 ? end($paths) : null;
转载于:https://my.oschina.net/u/4159874/blog/3071028
995

被折叠的 条评论
为什么被折叠?