Home > php教程 > PHP源码 > 简单的利用www.vsfxt.com支付宝订单查询系统实现订单查询

简单的利用www.vsfxt.com支付宝订单查询系统实现订单查询

PHP中文网
Release: 2016-05-25 16:59:58
Original
1505 people have browsed it

php代码

<?php
function curl_get_contents($url) { 
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch, CURLOPT_TIMEOUT, 5);
$buf = curl_exec($ch);
curl_close($ch);
return $buf;
}
$gateway = &#39;http://23.239.194.245:7000/&#39;;//网关
$tradeNo = &#39;2013111200001000920071958757&#39;;//交易号
$info = curl_get_contents($gateway.$tradeNo);
$arr  = json_decode($info);
if(is_object($arr)===false) {
echo &#39;Error&#39;;
}else {
foreach($arr as $key=>$value) {
  echo "交易号:",$key,"<br />","成交金额:",$value->fee,"<br />","成交时间:",$value->time;
}
}
?>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template