php接收纯json数据

我用curl/post方式发送一段数据给一个接口文件发现$_POST输出为Array(),没有获取到任意字符串,百度上找到方法

1 function getRawData(){
2   $put = array();
3   parse_str(file_get_contents('php://input'), $put);
4   return $put;
5 }

 

posted @ 2015-07-30 09:53  李星保  阅读(220)  评论(0编辑  收藏  举报