我得到以下结果:http://www.example.com/Music/\2011 Hits\Balle Lakka.mp3
以下是str_replace
尝试将本地路径 URL 替换为http://
路径:
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT songlist.* FROM songlist WHERE ID='".$song->ID."'";
$result = mysql_query($query,$conn);
$i=0;
while($data = mysql_fetch_assoc($result))
{
while(list($key,$value) = each($data))
$arr[$i][$key] = $value;
$i++;
}
$file = str_replace("C:\inetpub\Music","http://www.example.com/Music/",$arr[0]['filename']);