Danielxmovies
Gebruiker
- Lid geworden
- 8 okt 2011
- Berichten
- 300
Hallo mensen,
Ik ben bezig met een app. Maar ik wil nu de nieuwste video van een youtube kanaal laten zien. Ik heb nu gevonden dat dit met Json kan.
Ik probeer nu 2 variabelen eruit te krijgen.
videoId en title.
Dit is de var_dump van de json:
Dit is mijn huidige PHP code:
Kan iemand mij helpen?
Ik ben bezig met een app. Maar ik wil nu de nieuwste video van een youtube kanaal laten zien. Ik heb nu gevonden dat dit met Json kan.
Ik probeer nu 2 variabelen eruit te krijgen.
videoId en title.
Dit is de var_dump van de json:
Code:
array(5) {
["kind"]=>
string(26) "youtube#searchListResponse"
["etag"]=>
string(57) ""FOuwADrXJjsTKgUIQJoQC6nKNFY/Dm2wuEnALNLzRrg2GQqX7OUoHig""
["nextPageToken"]=>
string(6) "CAEQAA"
["pageInfo"]=>
array(2) {
["totalResults"]=>
int(205)
["resultsPerPage"]=>
int(1)
}
["items"]=>
array(1) {
[0]=>
array(4) {
["kind"]=>
string(20) "youtube#searchResult"
["etag"]=>
string(57) ""FOuwADrXJjsTKgUIQJoQC6nKNFY/2YbQA5pqMZbHpb8wT-3sCXdVFU8""
["id"]=>
array(2) {
["kind"]=>
string(13) "youtube#video"
["videoId"]=>
string(11) "q3VW1qoOOEw"
}
["snippet"]=>
array(7) {
["publishedAt"]=>
string(24) "2014-07-04T14:00:04.000Z"
["channelId"]=>
string(24) "UCNz5474yx24nxVygk6kunLQ"
["title"]=>
string(26) "MAARTEN!? - Outlast DLC #8"
["description"]=>
string(130) "FACEBOOK: https://www.facebook.com/lekkerspelen TWITTER: https://twitter.com/Lekker_spelen TWITCH: https://twitch.tv/lekkerspelen."
["thumbnails"]=>
array(3) {
["default"]=>
array(1) {
["url"]=>
string(46) "https://i.ytimg.com/vi/q3VW1qoOOEw/default.jpg"
}
["medium"]=>
array(1) {
["url"]=>
string(48) "https://i.ytimg.com/vi/q3VW1qoOOEw/mqdefault.jpg"
}
["high"]=>
array(1) {
["url"]=>
string(48) "https://i.ytimg.com/vi/q3VW1qoOOEw/hqdefault.jpg"
}
}
["channelTitle"]=>
string(0) ""
["liveBroadcastContent"]=>
string(4) "none"
}
}
}
}
Array
Dit is mijn huidige PHP code:
PHP:
<?php
$response = file_get_contents("https://www.googleapis.com/youtube/v3/search?key=jammerjoh&channelId=UCNz5474yx24nxVygk6kunLQ&part=snippet,id&order=date&maxResults=1");
$json = json_decode($response, true);
echo "<pre>";
var_dump($json);
echo "</pre>";
echo $json;
?>
Kan iemand mij helpen?
