我通过php代码从其他网站获取数据,如下所示:
$page = file_get_contents('website');
$doc = new DomDocument('1.0', 'utf-8');
$doc->validateOnParse = true;
libxml_use_internal_errors(true);
$doc->loadHTML($page);
echo $doc->textContent;
我得到的数据看起来像这样
string(185180) " [
{
"Id": "50671661",
"date": "2017-09-26T00:00:00+0000",
"DEP": "JFK",
"ARR": "BEG"
},
{
"Id": "50671689",
"date": "2017-09-26T00:00:00+0000",
"DEP": "BEG",
"ARR": "AUH"
},
{
"Id": "50671663",
"date": "2017-09-26T00:00:00+0000",
"DEP": "BEG",
"ARR": "LCA",
},
....
]"
如何设计收到的数据?