所以我对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>'