用PHP接收JSON帖子
echo $_POST;
Array
if ( $_POST ) { foreach ( $_POST as $key => $value ) { echo "llave: ".$key."- Valor:".$value."<br />"; }}
$string = $_POST['operation'];$var = json_decode($string);echo $var;
$data = json_decode( file_get_contents('php://input') );var_dump( $data->operation );
$data = json_decode(file_get_contents('php://input'), true);var_dump($data);
NULL
{ "operacion": { "tok": "[generated token]", "shop_id": "12313", "respuesta": "S", "respuesta_details": "respuesta S", "extended_respuesta_description": "respuesta extendida", "moneda": "PYG", "monto": "10100.00", "authorization_number": "123456", "ticket_number": "123456789123456", "response_code": "00", "response_description": "Transacción aprobada.", "security_information": { "customer_ip": "123.123.123.123", "card_source": "I", "card_country": "Croacia", "version": "0.3", "risk_index": "0" } }}
蝴蝶不菲
慕后森
HUH函数