$json = file_get_contents('https://api.twitch.tv/kraken/streams');
$jsonDecoded = json_decode($json);
$fp = fopen('results.json', 'w');
fwrite($fp, json_encode($jsonDecoded));
fclose($fp);
から必要なフィールドは2つだけhttps://api.twitch.tv
です。
それはstreams->channel->nameとstreams->viewersです。
どうすればそれぞれの構造に適したものを作成できますか?