php随机获取金山词霸每日一句

 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);
原文地址:https://www.cnblogs.com/inc-is-include/p/5053488.html