php - 使用 PHP 格式化 JSON 数据

标签 php json

我有以下代码:

<?php
$ids = 'ids=com.hugogames.hugotrollwars';

$opts = array('http' =>
array(
    'method'  => 'POST',
    'header'  => 'Content-type: application/x-www-form-urlencoded',
    'content' => $ids
)
);
$context  = stream_context_create($opts);
$result = file_get_contents('https://play.google.com/store/xhr/getdoc', false,             
$context);

$convert = explode("\n", $result);

基本上它从 Playstore 中提取权限并将其显示为字符串。我遇到的问题是删除不需要的数据(图像链接、描述)并且只显示权限和权限描述。我尝试在 php 中使用 json_decode 函数,但它返回了 NULL。

有什么我想念的吗?

非常感谢任何帮助!

最佳答案

关于php - 使用 PHP 格式化 JSON 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22134494/

相关文章:

javascript - 使用ajax/javascript显示多个json数组

json - 从 Ruby 中的 JSON 文件解析并从嵌套哈希中提取数字

javascript - 过滤基于数组的属性值

php - 如何根据评分和发布时间找到最佳帖子?

javascript - 如何在 express 和 bodyParser 中接受 application/csp-report 作为 json?

php - URL参数值加密/解密

php - 使用explode、split或preg_split来存储和获取多个数据库条目

javascript - 我怎样才能使这段 Javascript 代码不引人注目?

php - Windows telnet 给出不同的结果

php - Android/php : Using PDO to retrieve a set of results using 'LIKE' , 并解析为 JSON