PHP接受json数据

PHP接受json数据

获取请求的参数

  $input = file_get_contents("php://input");
  $input = json_decode($input,true);
  var_dump($input);

获取文件的json

$input = file_get_contents("../XX.json");

CSDN上的一个老哥少打了一个contents,少打了一个“s”,O(∩_∩)O哈哈~

posted @ 2020-07-23 12:26  李家的张麻子  阅读(300)  评论(0)    收藏  举报