获取国家统计局最新数据
<?php
$dsn = 'mysql:host=127.0.0.1;dbname=test';
$db = new PDO($dsn, 'root', 'admin888');
// 超时设置
ini_set('max_execution_time', '0');
header("Content-type: text/html; charset=gb2312");
$index = file_get_contents("http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2020/index.html");
preg_match_all('/<a href=\'(\d{2,4}).html\'>(.{3,20})<br\/><\/a>/', $index, $matches);
echo '<pre>';
$url = 'http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2020/';
error_reporting(0);
$provinces = $prov = array(
array(),
array(11, 12, 13, 14, 15, 21, 22, 23, 31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 50, 51, 52, 53, 54, 61, 62, 63, 64, 65),
array(&