javaScript学习笔记:AXAJ基础
一、准备工作
1、python案列:查询城市天气并绘制最高气温与最低气温折线图
2、使用JSON Viever直观查看JSON数据
二、任务
任务2、输入城市代码,返回城市天气预报信息
包含城市名、当天最高气温与最低气温、天气类型、年月日、星期几。
1、task01.php

2、do_task01.php
// 获取页面内容
$html = file_get_contents($url);
// 转换成json
$weather = json_decode($html, true);
// 解析所需信息
$parent = $weather['cityInfo']['parent'];
$city = $weather['cityInfo']['city'];
$high = $weather['data']['forecast'][0]['high'];
$low = $weather['data']['forecast'][0]['low'];
$ymd = $weathe
3524



被折叠的 条评论
为什么被折叠?



