tp5 獲取post,get,參數,表單上傳的內容


原文:https://www.jianshu.com/p/90917829460a

use think\Request;

class Name

{

    $request = Request::instance();

    $method = $request->method();//獲取上傳方式

    $request->param();//獲取所有參數,最全

    $get = $request->get();獲取get上傳的內容

    $post = $request->post();獲取post上傳的內容

    $request->file('file')獲取文件

}
View Code

use think\Controller;
class Name
{
    $method = $this->request->method();//獲取上傳方式

     $this->request->param();//獲取所有參數,最全

    $get =  $this->request->get();獲取get上傳的內容

    $post =  $this->request->post();獲取post上傳的內容

    $this->request->file('file')獲取文件

}
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM