所以我对 mp3 文件的链接有问题。我可以让 mp3 显示在页面上,但它们都没有使用文件夹中的相应文件。我在文件夹中的所有歌曲都位于 xampp 文件夹的 htdocs 中。我真的不明白发生了什么。任何答案都会有所帮助。谢谢!
</head>
<body>
<div id="header">
<h1>190M Music Playlist Viewer</h1>
<h2>Search Through Your Playlists and Music</h2>
</div>
<div id="listarea">
<ul id="musiclist">
<?php
$path = 'C:/xampp/htdocs/songs/*mp3';
foreach (glob($path) as $mp3) {
$k = pathinfo($mp3);
$m = $k['basename'];
$v = explode(".",$k['basename']);
echo "<li class=\"mp3item\"><a href='#' data- src='dir/".$m."'>".$v[0]."</a></li>";
}
$path2 = 'C:/xampp/htdocs/songs/*txt';
foreach (glob($path2) as $txt) {
$k2 = pathinfo($txt);
$m2 = $k2['basename'];
$v2 = explode(".",$k2['basename']);
echo "<li class=\"playlistitem\"><a href='#' data- src='dir/".$m2."'>".$v2[0]."</a></li>";
}
?>
</ul>
</div>
</body>
</html>'