I'm trying to read certain videos names off of youtube, I have it working correctly, although it seems that certain symbols will show as other weird symbols. (Unicode I think??)
function get_youtube_title($video_id){
$url = "http://www.youtube.com/watch?v=".$video_id;
$page = file_get_contents($url);
$doc = new DOMDocument();
$doc->loadHTML($page);
$title_div = $doc->getElementById('eow-title');
$title = $title_div->nodeValue;
return $title;
}
echo get_youtube_title('e3Nl_TCQXuw');
I should be getting "Beauty and the Beast - US Official Final Trailer"
Instead I'm getting "Beauty and the Beast â US Official Final Trailer"
Thank you