Creating a Embed that only shows when stream is online

Like so?

<?php
$streamChannel = "overwatchleague";  

$json_array = json_decode(file_get_contents("https://api.twitch.tv/kraken/streams.json?channel=overwatchleague"), true);  

if(isset($json_array['streams'][0]['channel'])) {  
echo "<div id='streamonline'><iframe
src="http://player.twitch.tv/?channel= overwatchleague&muted=true"
name="report"
height="100%"
width="100%"
frameborder="0"
scrolling="no"
allowfullscreen="true">
</iframe></div>";  
} else {  
echo "<div id='streamoffline'>Display 0</div>";  
}  

?>