<?php require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $city = '安顺';//utf8 $cityid='111';//任选 $url = "http://api.binstd.com/weather2/query?appkey=$appkey&city=$city"; $result = curlOpen($url); $jsonarr = json_decode($result, true); //exit(var_dump($jsonarr)); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $result = $jsonarr['result']; echo $result['cityid'].' '.$result['date'].' '.$result['weather'].' '.$result['temphigh'].' '.$result['templow'].' '.$result['img'].' '.$result['humidity'].' '.$result['pressure'].' '.$result['windspeed'].' '.$result['winddirect'].' '.$result['windpower'].' '.$result['sunrise'].' '.$result['sunset'].' '.$result['aqi'].' '.$result['primarypollutant'].' '.$result['cityname'];