PHP dump $_REQUEST to file

后端 未结 4 1694
Happy的楠姐
Happy的楠姐 2021-02-02 08:20

I want to dump request variables to a file for debugging. How\'s this possible?

4条回答
  •  你的背包
    2021-02-02 09:08

    Use serialize() function for dumping. Dump $_SERVER, $_COOKIE, $_POST and $_GET separately (may go to the same file). If you're planning on debugging with the data it helps to know if the data was part of a POST request or a GET request.

    Dumping everything is good for debugging in development, but not so in production. If your application does not have many users, it can work in production too. If you anticipate many users, consider dumping just the $_POST data, or limit server variables to those starting with HTTP_.

提交回复
热议问题