PHP編寫(xiě)的HTTP下載類(lèi)代碼_PHP教程
Jul 13, 2016 pm 05:41 PM
功能比較全的下載http資源類(lèi),同時(shí)可以獲得http頭的信息。
- class DedeHttpDown
- {
- ?? ??? ?public $m_url = "";
- ?? ??? ?public $m_urlpath = "";
- ?? ??? ?public $m_scheme = "http";
- ?? ??? ?public $m_host = "";
- ?? ??? ?public $m_port = "80";
- ?? ??? ?public $m_user = "";
- ?? ??? ?public $m_pass = "";
- ?? ??? ?public $m_path = "/";
- ?? ??? ?public $m_query = "";
- ?? ??? ?public $m_fp = "";
- ?? ??? ?public $m_error = "";
- ?? ??? ?public $m_httphead = "" ;
- ?? ??? ?public $m_html = "";
- ?
- ?? ??? ?//初始化系統(tǒng)
- ?? ??? ?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;
- ?? ??? ??? ??? ??? ??? ?}
- ?? ??? ??? ??? ?}
- ?? ??? ?}
- ?? ??? ?//打開(kāi)指定網(wǎng)址
- ?? ??? ?function OpenUrl($url)
- ?? ??? ?{
- ?? ??? ??? ??? ?//重設(shè)各參數(shù)
- ?? ??? ??? ??? ?$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();
- ?? ??? ??? ??? ?//初始化系統(tǒng)
- ?? ??? ??? ??? ?$this->PrivateInit($url);
- ?? ??? ??? ??? ?$this->PrivateStartSession();
- ?? ??? ?}
- ?? ??? ?//獲得某操作錯(cuò)誤的原因
- ?? ??? ?function printError()
- ?? ??? ?{
- ?? ??? ??? ??? ?echo "錯(cuò)誤信息:".$this->m_error;
- ?? ??? ??? ??? ?echo "具體返回頭:
"; - ?? ??? ??? ??? ?foreach($this->m_httphead as $k=>$v)
- ?? ??? ??? ??? ?{
- ?? ??? ??? &nb

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PhpisstillRelevantinmodernenterpriseenvironments.1. Modernphp (7.xand8.x)? ??? ??, ??? ??, jitcompilation ? modernsyntax, mateitsuilableforlarge-scalepplications

MAC ?? ???? ? ??? ?? ??? ????? ?? ? ??? ????? ????. 1. ???? ???? ???? ???? ??? ?? ? ?? ????? ??? ???? ??????. 2. ????? ?? ?? ? ??? ???? ???? ?? ?? ????? ??? ???? ?????. 3. ??? ?? ??? ???? ?? ???? ?? ???? ?? ???? ?? ? ? ????. 4. ??? ????? ????? ? ?? ?? ? ??? ?? ? ??? ??????.
