Als je niet die hele winamp-layout wilt, ik heb hier ooit 'n heel simpel php-scriptje voor gemaakt:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| <?php
/*
* Author: Blizt (info@blizt.nl)
* Created: 07 september 2004
* Filename: playlist/index.php
*/
error_reporting(E_ALL);
$rPlaylist = 'new8.m3u';
//set the right charset and mimetype
$sMime = 'text/html';
header('content-type:' . $sMime . ';charset=utf-8');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Playlist - <?php echo $rPlaylist; ?></title>
<?php
//read the contents into an array
$aContent = file($rPlaylist);
echo '<ol id="playlist">';
//$iSongs = count($aContent);
$sSong = '';
$aReplace = array(
'([0-9]{1,9},)'
);
foreach($aContent as $key => $sSong)
{
if($key % 2 == 1)
{
$sSong = substr($sSong,8);
$sSong = preg_replace($aReplace,"",$sSong);
$sSong = htmlspecialchars($sSong);
echo '<li>' . utf8_encode($sSong) . '</li>';
}
}
echo '</ol>';
?> |
Ik heb er even een paar niet-nuttige dingen uitgesloopt, dus werking is niet gegarandeerd