array('method' => 'HEAD')) ); //get_headers follows redirects automatically $headers = get_headers($url, 1); if ($headers !== false && isset($headers['Location'])) { return end($headers['Location']); } return $url; } function sendList($path) { $startitems = 1; $enditems = 10; if (isset($_GET['startitems'])) { $startitems = (int) $_GET['startitems']; } if (isset($_GET['enditems'])) { $enditems = (int) $_GET['enditems']; } header('Content-type: text/xml'); echo << -1 Message $path Dir $path http://radio567.vtuner.com/$path http://radio5672.vtuner.com/$path XML; } function sendMessage($msg) { header('Content-type: text/xml'); $xMsg = htmlspecialchars($msg); echo << Message $xMsg XML; } function sendListItems($listItems) { $xml = '' . "\n"; $xml .= '' . "\n"; foreach ($listItems as $item) { $xml .= $item . "\n"; } $xml .= "\n"; header('Content-type: text/xml'); echo $xml; } ?>