dongshuo2752
2018-08-28 13:13
浏览 197
已采纳

将curl响应保存到数据库中

I am getting this response

[{"id":15702671,"payment_id":15702666,"amount":20,"metadata":{},"source":{"id":"347862165","name":"Test Test","type":"collector"},"date_created":"2018-08-28T08:11:15.000-04:00","unique_sequence_number":null,"status":"approved"}]

This is my Code

$url = "https://api.mercadopago.com/v1/payments/".$paymeny_id."/refunds?access_token=TEST-4015220099523401-082300-232be80199d9b1a9b0bac72d6af99fd2-347862165";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
curl_close($ch);

how to save response value in variable ?

图片转代码服务由CSDN问答提供 功能建议

我收到此回复</ p>

  [{“id”  :15702671,“payment_id”:15702666,“amount”:20,“metadata”:{},“source”:{“id”:“347862165”,“name”:“Test Test”,“type”:“collector”  “},” DATE_CREATED “:” 2018-08-28T08:11:15.000-04:00" , “unique_sequence_number”:NULL, “状态”: “已批准”}] 
上</代码> </ PRE> 
  
 

这是我的代码</ p>

  $ url =“https://api.mercadopago.com/v1/payments/".$paymeny_id."/refunds?  access_token = TEST-4015220099523401-082300-232be80199d9b1a9b0bac72d6af99fd2-347862165“; 
 $ ch = curl_init(); 
curl_setopt($ ch,CURLOPT_URL,$ url); 
 $ output = curl_exec($ ch); 
curl_close($ ch  ); 
 </ code> </ pre> 
 
 

如何在变量中保存响应值?</ p> </ div>

2条回答 默认 最新

相关推荐 更多相似问题