1先把你的MP3文件上傳到華為網盤http://www.dbank.com/
2然後把網盤上的MP3文件共享http://dl.dbank.com/c03vylqaa5
3然後把共享的地址替換到 $url變量裡面就可以了
大概的原理就是這樣
直接貼華為網盤外鏈的正在使用的測試代碼了。大家測試完記得如果有改進什麼的留言給我,我去你那裡借鑒下。如果轉載請把原文附上個地址算是對我的支持!
[php] <?php
$url='http://dl.dbank.com/c03vylqaa5';
$fp1=fopen($url,"r");
//$fp2=fopen("t2.txt","w");
while(!feof($fp1)){
$a=fgets($fp1);
ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);
if($a_arr[1]!=""){
//print_r($a_arr);
$mp3_url_a=$a_arr[1];
}
unset($a_arr);
}
$mp3_url_b='http://dl.dbank.com/download/';
$sg=$mp3_url_b.$mp3_url_a;
//$a=' <a id="1" name="list" title="Pub_30.mp3" stype="audio" status="0" cnt="35" cnt1="" size="501184" downloadUrl="http://dl.dbank.com/download/Pub_30.mp3?f=c03vylqaa5&i=1&h=1336754543&v=2ae7c1b5&u=acd24b23&ip=117.67.240.27&p=0" nspurl="http://file.dbank.com/file/MDAwMDAwMDGGcdM4xsCjehJZk5_PVkbcvOQQesha3ozaxUDCQvuSOg../36965e90de0a7b0df17d0783c90a349f7a5c0" href="#" class="ico ico-audio">Pub_30.mp3</a>';
// ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);
// print_r($a_arr);
?>
<embed src="<?php echo $sg;?>" loop="false" autostart="true" volume=0 hidden="true"></embed>
<?php
$url='http://dl.dbank.com/c03vylqaa5';
$fp1=fopen($url,"r");
//$fp2=fopen("t2.txt","w");
while(!feof($fp1)){
$a=fgets($fp1);
ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);
if($a_arr[1]!=""){
//print_r($a_arr);
$mp3_url_a=$a_arr[1];
}
unset($a_arr);
}
$mp3_url_b='http://dl.dbank.com/download/';
$sg=$mp3_url_b.$mp3_url_a;
//$a=' <a id="1" name="list" title="Pub_30.mp3" stype="audio" status="0" cnt="35" cnt1="" size="501184" downloadUrl="http://dl.dbank.com/download/Pub_30.mp3?f=c03vylqaa5&i=1&h=1336754543&v=2ae7c1b5&u=acd24b23&ip=117.67.240.27&p=0" nspurl="http://file.dbank.com/file/MDAwMDAwMDGGcdM4xsCjehJZk5_PVkbcvOQQesha3ozaxUDCQvuSOg../36965e90de0a7b0df17d0783c90a349f7a5c0" href="#" class="ico ico-audio">Pub_30.mp3</a>';
// ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);
// print_r($a_arr);
?>
<embed src="<?php echo $sg;?>" loop="false" autostart="true" volume=0 hidden="true"></embed>
摘自 cyuyan112233的專欄