PHP 中TP5 Request 请求对象的实例详解
发布时间:2021-02-27 11:38:13 所属栏目:PHP教程 来源:网络整理
导读:PHP 中TP5 Request 请求对象 public/index.php // [ 应用入口文件 ] // 定义应用目录 define('APP_PATH',DIR . '/../app/'); // 定义配置文件目录和应用目录同级 define('CONF_PATH',DIR.'/../config/'); // 加载框架引导文件 require DIR . '/../thinkphp
PHP 中TP5 Request 请求对象public/index.php// [ 应用入口文件 ]// 定义应用目录 define('APP_PATH',DIR . '/../app/'); // 定义配置文件目录和应用目录同级 // 加载框架引导文件 appindexcontrollerIndex.php domain()); dump($request->pathinfo()); dump($request->path());
} 地址栏输入的链接: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编程网 - 黄冈站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |