1 header('Content-Type:text/html; charset=utf-8'); 2 $nowyear=date("Y"); 3 $nowmouth = date('m'); 4 $nowday = date('d'); 5 $date = mt_rand("2012",$nowyear)."-".mt_rand("1",$nowmouth)."-".mt_rand("1",$nowday); 6 7 $content=file_get_contents('http://open.iciba.com/dsapi/?date='.$date); 8 $arr=json_decode($content,true); 9 echo "<pre>"; 10 print_r($arr);