百度网盘直链函数
http://pan.baidu.com/share/link?shareid=401091&uk=3691445095
百度网盘直链函数<?php <br />
function baiduPanUrl($panUrl) {<br>
$opts = array (<br>
'http' => array (<br>
'method' => "GET",<br>
'timeout' => 5 <br>
) <br>
);<br>
$context = stream_context_create ( $opts );<br>
$html = file_get_contents ( $panUrl, false, $context );<br>
$pattern = '/' . preg_quote ( 'http://www.baidupcs.com/file/', '/' ) . '(.*?)' . preg_quote ( '"', '/' ) . '/i';<br>
preg_match_all ( $pattern, $html, $result );<br>
$url = $result [1] [0];<br>
$url = str_replace ( '&', '&', $url );<br>
return 'http://www.baidupcs.com/file/' . $url;<br>
}<br>
echo baiduPanUrl('http://pan.baidu.com/share/link?shareid=401091&uk=3691445095');
AD:真正免费,域名+虚机+企业邮箱=0元