In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the uses of the input method in thinkphp". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the use of the input method in thinkphp".
The use of the input method in thinkphp: 1, to determine whether the variable is defined, the syntax is "input ('? post.name')"; 2, to obtain the PARAM parameter, the syntax is "input ('param.')"; 3, to obtain the GET parameter, the syntax is "input (' get.')".
This article operating environment: Windows10 system, ThinkPHP5 version, Dell G3 computer.
What is the use of the input method in thinkphp
1. Determine whether the variable is defined
Input ('? get.id'); input ('? post.name')
Variable type methods include:
Method description: param get the currently requested variable get get $_ GET variable post get $_ POST variable put get $_ PUT variable delete get $_ DELETE variable session get $_ SESSION variable cookie get $_ COOKIE variable request get $_ REQUEST variable server get $_ SERVER variable env get $_ ENV variable route get route (including PATHINFO) variable file get $_ FILE variable
two。 Get the PARAM parameter
Input ('param.name'); / / get a single parameter input (' param.'); / / get all parameters / / here is the equivalent input ('name'); input ('')
3. Get the GET parameter
/ / get a single variable input ('get.id'); / / use the filtering method to get the default empty string input (' get.name'); / / get all variables input ('get.')
4. Use the filtering method
Input ('get.name','','htmlspecialchars'); / / get get variables and filter input (' username','','strip_tags') with the htmlspecialchars function; / / get param variables and filter input ('post.name','','org\ Filter::safeHtml') with the strip_tags function; / / get post variables and filter using the safeHtml method of the org\ Filter class
5. Use variable modifiers
Input ('get.id/d'); input (' post.name/s'); input ('post.ids/a'); modifier s cast to string type d cast to integer type b cast to Boolean type a cast to array type f cast to floating point type
Thank you for your reading, the above is the content of "what is the use of input method in thinkphp". After the study of this article, I believe you have a deeper understanding of the use of input method in thinkphp, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.