fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $output = '{"items":[{"kind":"youtube#channel","statistics":{"viewCount":45265617,"commentCount":29,"subscriberCount":183369,"hiddenSubscriberCount":21,"videoCount":429}}]}';
  5. $channels_inf = json_decode($output, true);
  6. print_r($channels_inf);
  7. echo $channels_inf['items']['0']['statistics']['videoCount'];
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
Array
(
    [items] => Array
        (
            [0] => Array
                (
                    [kind] => youtube#channel
                    [statistics] => Array
                        (
                            [viewCount] => 45265617
                            [commentCount] => 29
                            [subscriberCount] => 183369
                            [hiddenSubscriberCount] => 21
                            [videoCount] => 429
                        )

                )

        )

)
429