3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stream = 'monstercat'; $url = sprintf('https://api.twitch.tv/api/channels/%s/access_token/', $stream); $page = file_get_contents($url); $json = json_decode($page, true); $token = $json['token']; $sig = $json['sig']; echo 'http://usher.twitch.tv/api/channel/hls/' . $stream . '.m3u8?player=twitchweb&token=' . rawurlencode($token) . '&sig=' . $sig;

preferences:
39.6 ms | 402 KiB | 5 Q