简单的利用www.vsfxt.com支付宝订单查询系统实现订单查询
程序员文章站
2022-05-20 14:49:51
...
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 = 'http://23.239.194.245:7000/';//网关 $tradeNo = '2013111200001000920071958757';//交易号 $info = curl_get_contents($gateway.$tradeNo); $arr = json_decode($info); if(is_object($arr)===false) { echo 'Error'; }else { foreach($arr as $key=>$value) { echo "交易号:",$key,"<br />","成交金额:",$value->fee,"<br />","成交时间:",$value->time; } } ?>
上一篇: Oracle 10G中创建多监听端口问题
下一篇: php实现简单文件下载的方法