Provides various official and user-released code examples and code reference. You are welcome to exchange and learn Baidu online drive straight chain functions.
Http://pan.baidu.com/share/link? Consumer id = 401091 & uk = 3691445095
Baidu online drive straight chain function
Function baiduPanUrl ($ panUrl ){
$ Opts = array (
'Http' => array (
'Method' => "GET ",
'Timeout' => 5
)
);
$ Context = stream_context_create ($ opts );
$ Html = file_get_contents ($ panUrl, false, $ context );
$ Pattern = '/'. preg_quote ('HTTP: // www.baidupcs.com/file /','/').'(.*?) '. Preg_quote (' "','/').'/I ';
Preg_match_all ($ pattern, $ html, $ result );
$ Url = $ result [1] [0];
$ Url = str_replace ('&', '&', $ url );
Return 'HTTP: // www.baidupcs.com/file/'. $ url;
}
Echo baiduPanUrl ('HTTP: // pan.baidu.com/#/link? Required id = 401091 & uk = 3691445095 ');
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB