没有合适的资源?快使用搜索试试~ 我知道了~
本文实例为大家分享了php远程下载类,如下 <?php /** * 下载远程文件类支持断点续传 */ class HttpDownload { private $m_url = ""; private $m_urlpath = ""; private $m_scheme = "http"; private $m_host = ""; private $m_port = "80"; private $m_user = ""; private $m_pass = ""; private $m_path = "/"; private $m_query = ""; private $m_fp = "
资源推荐
资源详情
资源评论
php远程下载类分享远程下载类分享
本文实例为大家分享了php远程下载类,如下
<?php
/**
* 下载远程文件类支持断点续传
*/
class HttpDownload {
private $m_url = "";
private $m_urlpath = "";
private $m_scheme = "http";
private $m_host = "";
private $m_port = "80";
private $m_user = "";
private $m_pass = "";
private $m_path = "/";
private $m_query = "";
private $m_fp = "";
private $m_error = "";
private $m_httphead = "" ;
private $m_html = "";
/**
* 初始化
*/
public function PrivateInit($url){
$urls = "";
$urls = @parse_url($url);
$this->m_url = $url;
if(is_array($urls)) {
$this->m_host = $urls["host"];
if(!empty($urls["scheme"])) $this->m_scheme = $urls["scheme"];
if(!empty($urls["user"])) $this->m_user = $urls["user"];
if(!empty($urls["pass"])) $this->m_pass = $urls["pass"];
if(!empty($urls["port"])) $this->m_port = $urls["port"];
if(!empty($urls["path"])) $this->m_path = $urls["path"];
$this->m_urlpath = $this->m_path;
if(!empty($urls["query"])) {
$this->m_query = $urls["query"];
$this->m_urlpath .= "?".$this->m_query;
}
}
}
/**
* 打开指定网址
*/
function OpenUrl($url) {
#重设各参数
$this->m_url = "";
$this->m_urlpath = "";
$this->m_scheme = "http";
$this->m_host = "";
$this->m_port = "80";
$this->m_user = "";
$this->m_pass = "";
$this->m_path = "/";
$this->m_query = "";
$this->m_error = "";
$this->m_httphead = "" ;
$this->m_html = "";
$this->Close();
#初始化系统
$this->PrivateInit($url);
$this->PrivateStartSession();
}
/**
* 获得某操作错误的原因
资源评论
weixin_38694800
- 粉丝: 4
- 资源: 1021
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功