나는 이와 같은 URL이 있습니다
localhost / handikap / insert / index.php? json = { "id": 123456}
다음과 같은 코드를 작성하는 동안 json 응답을 얻고 싶습니다.
$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
그러나 이것은 아무것도 반환하지 않습니다.
GET 방법을 사용하는 경우
$data = $_GET['json'];
$data = json_decode();
print_r($data);
POST 방식을 사용하는 경우
$data = file_get_contents('php://input');
$data = (array)json_decode($data,true);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다