so, i need something like this?
<?php
$names[] = "xxxxxx";
$names[] = "xxxxxx";
$url = "https://api.twitch.tv/helix/streams?user_login=’ . implode(’&user_login=’, $names)";
foreach ($names as $channel) {
$request_params = array(
'client_id' => 'xxxxxxxxx'
);
$params = http_build_query($request_params);
$result = json_decode(curl_init('https://api.twitch.tv/helix/streams/'. $channel . '/?'. $params));
curl_setopt($result, CURLOPT_RETURNTRANSFER, true);
curl_setopt($result, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($result, CURLOPT_HEADER, false);
$html = curl_exec($result);
curl_close($result);
$game_ID = $result -> stream -> id;
$stream_name = $result -> stream -> game;
$stream_status = $result -> stream -> channel -> status;
$url_channel = $result -> stream -> channel -> url;
$img_preview = $result -> stream -> preview -> template;
foreach ($result->data as $stream) {
echo '<iframe src="https://player.twitch.tv/?channel=' . strtolower($stream->user_name) . '" frameborder="0" allowfullscreen="true" scrolling="no" height="378" width="620"></iframe>';
}
}
?>