HTTP PUT, DELETE and I/O streams with PHP

我是研究僧i 提交于 2019-12-05 17:00:17

No, you will need to parse the request manually. $_REQUEST only contains data coming from GET and POST requests; for everything else you are on your own.

If your HTTP request has Content-Type: application/x-www-form-urlencoded, you can parse it back into a variables array very easily with parse_str like this:

parse_str(file_get_contents('php://input'), $vars);
print_r($vars);

You can use this content type with any HTTP method, there is no standard-imposed limitation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!