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

相關文章
相關標籤/搜索