码迷,mamicode.com
首页 > 其他好文 > 详细

模拟获取post数据的方式

时间:2018-01-26 14:04:09      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:php   gpo   ini   input   body   获取   指令   方法   col   

使用下面两种方法可以获取post数据

1.通过$HTTP_RAW_POST_DATA获取

$post=$GLOBALS[HTTP_RAW_POST_DATA];

但需要修改相应的php.ini指令

2.通过php://input获取(建议使用这种方法 php://input数据总是和$HTTP_RAW_POST_DATA相同,但php://input更高效且不需要修改php.ini)

$post=file_get_contents("php://input"); 

 

模拟获取post数据的方式

标签:php   gpo   ini   input   body   获取   指令   方法   col   

原文地址:https://www.cnblogs.com/phpper/p/8358986.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!