您的位置:首页 > 编程语言 > PHP开发

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

2015-12-17 11:21 609 查看
header('Content-Type:text/html; charset=utf-8');
$nowyear=date("Y");
$nowmouth = date('m');
$nowday = date('d');
$date = mt_rand("2012",$nowyear)."-".mt_rand("1",$nowmouth)."-".mt_rand("1",$nowday);

$content=file_get_contents('http://open.iciba.com/dsapi/?date='.$date);
$arr=json_decode($content,true);
echo "<pre>";
print_r($arr);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: