如何从另一个站点数据中获取样式

时间:2017-09-28 09:00:29

标签: javascript php html css

我通过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",
},
....
]"

如何设计收到的数据?

0 个答案:

没有答案