Receive JSON POST with PHP

前端 未结 7 2313
Happy的楠姐
Happy的楠姐 2020-11-21 04:42

I’m trying to receive a JSON POST on a payment interface website, but I can’t decode it.

When I print :

echo $_POST;

I get:

相关标签:
7条回答
  • 2020-11-21 05:28

    Try;

    $data = json_decode(file_get_contents('php://input'), true);
    print_r($data);
    echo $data["operacion"];
    

    From your json and your code, it looks like you have spelled the word operation correctly on your end, but it isn't in the json.

    EDIT

    Maybe also worth trying to echo the json string from php://input.

    echo file_get_contents('php://input');
    
    0 讨论(0)
提交回复
热议问题