YouTube Video XML using oembed

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.
Author: Owen
Added: Thursday, 01 Jan, 1970
Category: PHP

Code

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

Comments