I have a media page that I want to automatically update with the audio and corresponding picture. The audio file will be in folder "audio" named "song1.mp3". The picture will be in folder "images" named "song1.jpg". I have figured out the code to automatically update the audio files with a default image, but I want to add the image to the corresponding audio file. Here is my current code:
<?php
$dir=opendir("Audio");
$files=array();
while (($file=readdir($dir)) !== false)
{
if ($file != "." and $file != ".." and $file != "test.php")
{
array_push($files, $file);
}
}
closedir($dir);
sort($files);
foreach ($files as $file)
print "<a class='myPlayer' href='Audio/$file' style='background-image:url(images/logo.jpg)'>
</a>
";
?>
So I would want my 'Audio/$file' = to my 'Images/$file' with the same name. Any help would be appreciated.
Thanks,