`
jordan_micle
  • 浏览: 240333 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

PHP小记(10) - $_SERVER参数

阅读更多

$_SERVER

 

参数:

 

PHP_SELF - 返回字符串

 写道
/根目录/....../当前php文件
如 /root/dir1/index.php

 

REQUEST_URI - return string

 

假如当前页面地址栏为http://www.url.com/root/sth/index.php?a=a&b=b

$_SERVER['REQUEST_URI']的值为

 写道
/root/sth/index.php?a=a&b=b

 

SCRIPT_NAME - 访问的脚本文件

 

这个与REQUEST_URI的区别在于,仅仅返回脚本文件的名称。

如当前请求为:http://www.url.com/root/sth/index.php?a=a&b=b

SCRIPT_NAME的值为

 写道
/root/sth/index.php
不带后面的参数串。

 

YEAH

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics