YouTube Video XML using oembed

PHP

Use oembed to pull an xml of a YouTube video using its URL. Using simplexml_load_file you are able to convert the XML into an object for use.

Code

<?php  
$video_url = '';
$info = simplexml_load_file("http://www.youtube.com/oembed?url=" . $video_url . "&format=xml");
$title = $info->title; 
 ?>