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哈哈~

猜你喜欢

转载自www.cnblogs.com/HelloMrLee/p/13365621.html
今日推荐