Answer the question
In order to leave comments, you need to log in
How to get json request and issue a response to it in PHP?
Hello! I ran into this problem:
there is a resource that sends a json request, namely: "{ "warehouseId": 12345, "partnerWarehouseId": "54321", "skus": [ "1", "2", "3", . .. ] }" to my server, how can I make the response to this json request in the form of information output, namely: "skus" in order?
This code is passing an empty value:
$postData = file_get_contents(' php://input ');
$data = json_decode($postData, true);
echo json_encode($data['skus']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question