Home >php教程 >php手册 >取得当前路径与文件名--己解决

取得当前路径与文件名--己解决

WBOY
WBOYOriginal
2016-06-21 09:12:311582browse

解决|文件名

如我想取当前文件路径 http://localhost/page.php?page=2 ,
现在我知道 echo "http://".$HTTP_SERVER_VARS['HTTP_HOST'].$HTTP_SERVER_VARS['REQUEST_URI'];
可以取得,可是如果我想取得 http://localhost/page.php 怎么办?
echo "http://".$HTTP_SERVER_VARS['HTTP_HOST']. $_SERVER['PHP_SELF'];



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn