How can I get videoId
(selected on image) in PHP? It's my code and it's not working (I'm talking about echo [...]
). It returns:
Fatal error: Cannot access empty property in /home/****/public_html/ytshots/index.php on line 38
$url = 'https://www.googleapis.com/youtube/v3/search?maxResults=4&type=video&order=date&part=snippet&forUsername=MKL&key=****';
$data = file_get_contents($url);
$characters = json_decode($data);
echo $characters->$items['videoId'];