Q:

[PHP][Youtube api v3] retrieving the informations for a single video

I'm getting some trouble with the youtube api.  I would like to retrieve the informations from a single video. 
What I already got :
i can get videos from a specified playlist with all their informations (like the title, the description etc)
i get the id playlist from the Url : 
$playlist = $_GET['pl'];

then i get the videos informations from the playlist : 
$response = $youtube->playlistItems->listPlaylistItems('id,snippet,contentDetails', ['playlistId' => $playlist, 'maxResults' => '10']);

then i can easily get and show informations from those videos thanks to a foreach :
foreach($response['items'] as $video){
echo $video['contentDetails']['videoId']; 
echo $video['snippet']['title'];
echo substr($video['snippet']['description'], 0, 430);}

What I want :
now i just put the videoId into a link : 
href="index.php?requ=video&v=<?= $video['contentDetails']['videoId']; ? >&pl=<?= $playlist ? >"
this way i can get the videoId into the other page in which i embed the video :
$vid = $_GET['v'];
<iframe height ="432" width="760"  src="https://www.youtube.com/embed/<?= $vid; ? >"></iframe>

but here comes the problem, i can't get any informations from this video, when i try like that :
$viewing = $youtube->videos->listVideos("snippet", ['id' => $vid]);
echo $viewing['snippet']['title'];

it returns me NULL
If someone can help me a bit, it would be awesome

A:

I finally found the solution on my own. 
as I want to retrieve information from a list of videos (even if in this case the list is composed of 1 element), I just had to use a foreach to retrieve like this :
<? php foreach($viewing['items'] as $view): ? >
                        <p><h3><?= $view['snippet']['title']; ? ></h3></p>
                        <p><?= substr($view['snippet']['description'], 0, 430); ? ></p>
                        <? php endforeach; ? >

Hope it can help

