Home > php教程 > php手册 > PHP-华为网盘作为存储MP3的外链调用到网页(这个功能爽啊!省了空间而且还快!还不占本地资源)

PHP-华为网盘作为存储MP3的外链调用到网页(这个功能爽啊!省了空间而且还快!还不占本地资源)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:49:19
Original
1345 people have browsed it

1先把你的MP3文件上传到华为网盘http://www.dbank.com/

2然后把网盘上的MP3文件共享http://dl.dbank.com/c03vylqaa5

3然后把共享的地址替换到 $url变量里面就可以了

大概的原理就是这样

 

直接贴华为网盘外链的正在使用的测试代码了。大家测试完记得如果有改进什么的留言给我,我去你那里借鉴下。如果转载请把原文附上个地址算是对我的支持!

[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='                                                                          Pub_30.mp3';  
//  ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);  
//  print_r($a_arr);  
 
?> 
 
$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='                   Pub_30.mp3';
// ereg("^.*downloadUrl=\"http://dl.dbank.com/download/(.*)\" nspurl=\"http://.*$",$a,$a_arr);
// print_r($a_arr);

?>

 


摘自 cyuyan112233的专栏

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template