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; } } ?>