Simple Online/Offline Script Help Needed

Okay, so for example, if my Client ID was 12345678901234

Where do I put the Client-ID in relation to this code?

Would this also be correct before adding the client ID in:

<?php
$streamChannel = "mastersonothing";  
$url = "https://api.twitch.tv/kraken/streams.json?channel=mastersonothing"
$clientid = "12345678901234"

$json_array = json_decode(curl($url), true);  

if(isset($json_array['streams'][0]['channel'])) {  
echo "<div id='streamonline'>Stream is Online</div>";  
} else {  
echo "<div id='streamoffline'>Stream is Offline</div>";  
}  

?>

Thank you in advance!