My callAPI with curl method:
$callAPI = implode(“&user_login=”,$channels1);
$url=“https://api.twitch.tv/helix/streams?user_login=” . $callAPI;
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Accept: application/vnd.twitchtv.v5+json’,
‘Client-ID: CLIENT-ID’
));
$result = curl_exec($ch);
curl_close($ch);
This for print of complete array:
$str = json_decode($result, true);
print_r($str);
This is my array for 100 users list:
$channels1 = array(
‘USERNAME 01’
‘USERNAME 02’
‘USERNAME 03’
‘USERNAME 04’
‘USERNAME 05’
…
‘USERNAME 99’
‘USERNAME 100’
);