In one of my applications I am saving a YouTube video\'s id... Like "A4fR3sDprOE". I have to display its title in the application. I got the following code for getting
This is my solution. It´s very short.
$id = "VIDEO ID"; $videoTitle = file_get_contents("http://gdata.youtube.com/feeds/api/videos/${id}?v=2&fields=title"); preg_match("/(.+?)<\/title>/is", $videoTitle, $titleOfVideo); $videoTitle = $titleOfVideo[1];