I've got a text file that contains a youtube url code for example: BzRBCM89GvI
I want this to be placed inside a iFrame and the title of the file to be used as a title above the video. I almost have it but for some reason the link does not appear to be working. If i inspect the element the URL LOOKS good but when i copy paste it to a text editor i get this: https://www.youtube.com/embed/%EF%BB%BFBzRBCM89GvI
The extra: "%EF%BB%BF" mess it up i think.
This is the PHP code:
<?PHP
$projects = glob('images/Projects/Video/*');
foreach ($projects as &$project) {
$src = "https://www.youtube.com/embed/" . file_get_contents($project);
echo'<h3>' . str_replace(".txt","",str_replace("images/Projects/Video/","",$project)) . '</h3><iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="min-height: 300px; width: 100%;" type="text/html" src="' . $src . '"></iframe>';
}
?>
Any idea's why the extra bits are added or why it's not working?