TP类库解析和使用系列[Input类]
生活随笔
收集整理的這篇文章主要介紹了
TP类库解析和使用系列[Input类]
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
| [ 概述 ] Input類是新版新增的一個輸入數(shù)據(jù)管理類,提供了一些輸入數(shù)據(jù)的管理和過濾。 [ 方法 ] getInstance 實(shí)例化Input類 filter 設(shè)置數(shù)據(jù)過濾方法 以下方法都是動態(tài)方法: get 獲取get數(shù)據(jù) post 獲取post數(shù)據(jù) request 獲取request數(shù)據(jù) server 獲取server數(shù)據(jù) cookie 獲取cookie數(shù)據(jù) session 獲取session數(shù)據(jù) files 獲取files數(shù)據(jù) config 獲取配置參數(shù) lang 獲取語言參數(shù) globals 獲取全局變量 call 獲取其他輸入數(shù)據(jù) [ 示例 ] Input類的使用示例如下: $Input = Input::getInstance(); // 指定過濾方法 $Input->filter('addslashes'); // 獲取$_GET['userId'] $userId = $Input->get('userId'); // 獲取$_SESSION['username'] $username = $Input->session('username'); // 獲取./file_to_read.txt 的內(nèi)容 $content = $Input->call('file_get_contents','./file_to_read.txt');
|
轉(zhuǎn)載于:https://my.oschina.net/wxweven/blog/56592
總結(jié)
以上是生活随笔為你收集整理的TP类库解析和使用系列[Input类]的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 閱讀10大優點:為什麼你應該每天閱讀
- 下一篇: FreeMarker_模板引擎_代码自动