2

我从 YouTube 获取 JSON 格式的数据,但它返回 JSON 为gdata.io.handleScriptLoaded({key:value})

key由于响应不是 JSON 对象,我如何访问in php

4

2 回答 2

10

我自己找到了答案。

我将值传递给请求 url script-in-json。simplay 将其更改为json

于 2012-12-23T07:48:30.753 回答
1
$json = gdata.io.handleScriptLoaded({key:value});
    $res = json_decode($json);
    print $res->{'key'}; // it prints your value
于 2012-12-18T13:14:47.200 回答