如何从php中的URL获取pagename [英] how to get pagename from the URL in php

查看:81
本文介绍了如何从php中的URL获取pagename的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有,

我想从网址获取页面名称。例如

我的网址是
http://bytes.com/newthread.php


我希望获得页面名称newthread.php。我怎样才能做到这一点?请帮助我解决我的问题。


在此先感谢


亲切的问候,

Mohsin Rafique

解决方案

查看

_SERVER - PHP_SELF可能就是你要找的东西。


try parse_url() http://www.php.net/manual/en/function.parse-url.php

Hey all,
i want to get the page name from the url. e.g.
My URL is
http://bytes.com/newthread.php

and i want to get page name newthread.php. How can i do that? Kindly help me out to sort out my problem.

Thanks in Advance

kind regards,
Mohsin Rafique

解决方案

Check out


_SERVER - PHP_SELF may be what you''re looking for.


try parse_url() http://www.php.net/manual/en/function.parse-url.php


这篇关于如何从php中的URL获取pagename的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆