这篇文章主要介绍PHP中TP5 Request请求对象的示例分析,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
创新互联公司主要从事网站设计制作、成都网站设计、网页设计、企业做网站、公司建网站等业务。立足成都服务古塔,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220PHP 中TP5 Request 请求对象
public/index.php
app\index\controller\Index.php
domain()); dump($request->pathinfo()); dump($request->path()); # 请求类型 dump($request->method()); dump($request->isGet()); dump($request->isPost()); dump($request->isAjax()); # 请求的参数 dump($request->get()); dump($request->param()); dump($request->post()); //session('name', 'onestopweb'); //cookie('email', 'onestopweb@163.com'); //session(null); //cookie('email',null); dump($request->session()); dump($request->cookie()); dump($request->param('type')); dump($request->cookie('email')); # 获取模块 控制器 操作 dump($request->module()); dump($request->controller()); dump($request->action()); # 获取URL dump($request->url()); dump($request->baseUrl()); } }地址栏输入的链接:http://192.168.0.180:55/index/index/index.html?name=chaoyi&type=blog
string(23) "http://192.168.0.180:55" string(22) "index/index/index.html" string(17) "index/index/index" string(3) "GET" bool(true) bool(false) bool(false) array(2) { ["name"] => string(6) "chaoyi" ["type"] => string(4) "blog" } array(2) { ["name"] => string(6) "chaoyi" ["type"] => string(4) "blog" } array(0) { } array(1) { ["name"] => string(10) "onestopweb" } array(3) { ["username"] => string(6) "chaoyi" ["PHPSESSID"] => string(26) "nugcsr2j9krr2lhk8bntggl412" ["email"] => string(18) "onestopweb@163.com" } string(4) "blog" string(18) "onestopweb@163.com" string(5) "index" string(5) "Index" string(5) "index" string(45) "/index/index/index.html?name=chaoyi&type=blog" string(23) "/index/index/index.html"以上是“PHP中TP5 Request请求对象的示例分析”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!
网页标题:PHP中TP5Request请求对象的示例分析-创新互联
文章地址:http://cdxtjz.cn/article/pdshg.html