21.10.2019

<?php
$name = 'cwchrissc2'; 
$array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.$name), true);
if ($array['stream'] != null) {
echo 'online';
} else {
echo 'offline';
}
?>