3. 如何获取当前页面的路径?

问题:如何获取当前页面的路径?

回答:

参考代码如下:

function current_path() {
     return $_GET['q'];
}

Returns the current URL path of the page being viewed(返回当前浏览页面的URL路径)。