【问题标题】:HOW TO PHP JSON DATA convert PHP Treeview如何 PHP JSON 数据转换 PHP Treeview
【发布时间】: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 函数或代码?

【问题讨论】:

    标签: php json


    【解决方案1】:

    使用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);
    ?>
    

    来源:https://stackoverflow.com/a/8344667/4652564

    【讨论】:

      【解决方案2】:

      json_decode($jsonObject, true);

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-09-15
        • 1970-01-01
        • 1970-01-01
        • 2013-03-13
        • 2021-10-11
        • 1970-01-01
        • 1970-01-01
        • 2016-09-09
        相关资源
        最近更新 更多