【发布时间】:2023-03-27 07:47:01
【问题描述】:
大家好,我有一个 JSON 数据,我需要将此数据 Treeview 转换为 json 数据 url:http://torrent2dl.ml/json.php 恢复状态 = http://torrent2dl.ml/json.php?tree
我试着做http://torrent2dl.ml/hedef.php 如何将此数据转换为 php 函数或代码?
【问题讨论】:
大家好,我有一个 JSON 数据,我需要将此数据 Treeview 转换为 json 数据 url:http://torrent2dl.ml/json.php 恢复状态 = http://torrent2dl.ml/json.php?tree
我试着做http://torrent2dl.ml/hedef.php 如何将此数据转换为 php 函数或代码?
【问题讨论】:
使用json_decode():
<?php
$url = 'http://torrent2dl.ml/json.php';
$JSON = file_get_contents($url);
// echo the JSON (you can echo this to JavaScript to use it there)
echo $JSON;
// You can decode it to process it in PHP
$data = json_decode($JSON);
var_dump($data);
?>
【讨论】:
json_decode($jsonObject, true);
【讨论】: