国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? 生成靜態(tài)頁面的PHP類_PHP教程

生成靜態(tài)頁面的PHP類_PHP教程

Jul 21, 2016 pm 04:12 PM
dir php var ?? ?? ???? ??? ??

復(fù)制代碼 代碼如下:
class?html?
{?
????var?$dir;????????//dir?for?the?htmls(without/)?
????var?$rootdir;????//root?of?html?files(without/):html?
????var?$name;???????//html文件存放路徑?
????var?$dirname;????//指定的文件夾名稱?
????var?$url;????????//獲取html文件信息的來源網(wǎng)頁地址?
????var?$time;???????//html文件信息填加時的時間?
????var?$dirtype;????//目錄存放方式:year,month,,,,?
????var?$nametype;???//html文件命名方式:name?

????function?html($nametype='name',$dirtype='year',$rootdir='html')?
????{?
????????$this->setvar($nametype,$dirtype,$rootdir);?
????}?

????function?setvar($nametype='name',$dirtype='year',$rootdir='html')?
????{?
??????$this->rootdir=$rootdir;?
??????$this->dirtype=$dirtype;?
??????$this->nametype=$nametype;?
????}?

????function?createdir($dir='')?
????{?
????????$this->dir=$dir?$dir:$this->dir;?

????????if?(!is_dir($this->dir))?
????????{?
????????????$temp?=?explode('/',$this->dir);?
????????????$cur_dir?=?'';?
????????????for($i=0;$i????????????{?
????????????????$cur_dir?.=?$temp[$i].'/';?
????????????????if?(!is_dir($cur_dir))?
????????????????{?
????????????????@mkdir($cur_dir,0777);?
????????????????}?
????????????}?
????????}?
????}?

????function?getdir($dirname='',$time=0)?
????{?
????????$this->time=$time?$time:$this->time;?
????????$this->dirname=$dirname?$dirname:$this->dirname;?

????????switch($this->dirtype)?
????????{?
????????case?'name':?
????????if(empty($this->dirname))?
???????????$this->dir=$this->rootdir;?
????????else?
???????????$this->dir=$this->rootdir.'/'.$this->dirname;?
????????break;?
????????case?'year':?
????????$this->dir=$this->rootdir.'/'.date("Y",$this->time);?
????????break;?

????????case?'month':?
????????$this->dir=$this->rootdir.'/'.date("Y-m",$this->time);?
????????break;?

????????case?'day':?
????????$this->dir=$this->rootdir.'/'.date("Y-m-d",$this->time);?
????????break;?
????????}?

????????$this->createdir();?

????????return?$this->dir;?
????}?

????function?geturlname($url='')?
????{?
????????$this->url=$url?$url:$this->url;?

????????$filename=basename($this->url);?
????????$filename=explode(".",$filename);?
????????return?$filename[0];?
????}?

????function?geturlquery($url='')?
????{?
????????$this->url=$url?$url:$this->url;?

????????$durl=parse_url($this->url);?
????????$durl=explode("&",$durl[query]);?
????????foreach($durl?as?$surl)?
????????{?
??????????$gurl=explode("=",$surl);?
??????????$eurl[]=$gurl[1];?
????????}?
????????return?join("_",$eurl);?
????}?

????function?getname($url='',$time=0,$dirname='')?
????{?
????????$this->url=$url?$url:$this->url;?
????????$this->dirname=$dirname?$dirname:$this->dirname;?
????????$this->time=$time?$time:$this->time;?

????????$this->getdir();?

????????switch($this->nametype)?
????????{?
????????case?'name':?
????????$filename=$this->geturlname().'.htm';?
????????$this->name=$this->dir.'/'.$filename;?
????????break;?

????????case?'time':?
????????$this->name=$this->dir.'/'.$this->time.'.htm';?
????????break;?

????????case?'query':?
????????$this->name=$this->dir.'/'.$this->geturlquery().'.htm';?
????????break;?

????????case?'namequery':?
????????$this->name=$this->dir.'/'.$this->geturlname().'-'.$this->geturlquery().'.htm';?
????????break;?

????????case?'nametime':?
????????$this->name=$this->dir.'/'.$this->geturlname().'-'.$this->time.'.htm';?
????????break;?

????????}?
????????return?$this->name;?
????}?

????function?createhtml($url='',$time=0,$dirname='',$htmlname='')?
????{?
????????$this->url=$url?$url:$this->url;?
????????$this->dirname=$dirname?$dirname:$this->dirname;?
????????$this->time=$time?$time:$this->time;?
??????//上面保證不重復(fù)地把變量賦予該類成員?
????????if(empty($htmlname))?
????????????$this->getname();?
????????else?
????????????$this->name=$dirname.'/'.$htmlname;??//得到name?

????????$content=file($this->url)?or?die("Failed?to?open?the?url?".$this->url."?!");;?

///////////////關(guān)鍵步---用file讀取$this->url?

??
????????$content=join("",$content);?
????????$fp=@fopen($this->name,"w")?or?die("Failed?to?open?the?file?".$this->name."?!");?
????????if(@fwrite($fp,$content))?
????????return?true;?
????????else?
????????return?false;?
????????fclose($fp);?
????}?
/////////////////以name為名字生成html?

????function?deletehtml($url='',$time=0,$dirname='')?
????{?
????????$this->url=$url?$url:$this->url;?
????????$this->time=$time?$time:$this->time;?

????????$this->getname();?

????????if(@unlink($this->name))?
????????return?true;?
????????else?
????????return?false;?
????}?

????/**?
?????*?function::deletedir()?
?????*?刪除目錄?
?????*?@param?$file?目錄名(不帶/)?
?????*?@return?
?????*/?
?????function?deletedir($file)?
?????{?
????????if(file_exists($file))?
????????{?
????????????if(is_dir($file))?
????????????{?
????????????????$handle?=opendir($file);?
????????????????while(false!==($filename=readdir($handle)))?
????????????????{?
????????????????????if($filename!="."&&$filename!="..")?
??????????????????????$this->deletedir($file."/".$filename);?
????????????????}?
????????????????closedir($handle);?
????????????????rmdir($file);?
????????????????return?true;?
????????????}else{?
????????????????unlink($file);?
????????????}?
????????}?
????}?

}?
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/313728.htmlTechArticle復(fù)制代碼 代碼如下: ?php classhtml { var$dir;//dirforthehtmls(without/) var$rootdir;//rootofhtmlfiles(without/):html var$name;//html文件存放路徑 var$dirname;//指定的文...
? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

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

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP? AI ??? ?? ?? PHP ?? ?? ?? ??? ??? ?????. PHP? AI ??? ?? ?? PHP ?? ?? ?? ??? ??? ?????. Jul 25, 2025 pm 08:45 PM

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

PHP? ???? ?? ?? ??? ???? ?? PHP ?? ????? ?? ?? PHP? ???? ?? ?? ??? ???? ?? PHP ?? ????? ?? ?? Jul 25, 2025 pm 08:51 PM

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

PHP? ???? AI? ???? ??? ?? ?? PHP ?? ?? ? ???? ?????. PHP? ???? AI? ???? ??? ?? ?? PHP ?? ?? ? ???? ?????. Jul 25, 2025 pm 08:57 PM

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

PHP? PHP ?? ?? ? ?? ??? ??? ?????? ??? ??? ???? ????. PHP? PHP ?? ?? ? ?? ??? ??? ?????? ??? ??? ???? ????. Jul 25, 2025 pm 08:27 PM

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

PHP? ???? AI? ???? ???? ???? ??. PHP? ???? ?? ??? ????? PHP? ???? AI? ???? ???? ???? ??. PHP? ???? ?? ??? ????? Jul 25, 2025 pm 07:21 PM

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

PHP? ?? ?? ?? ? ?? ?? PHP ?? ??? ? ?? ????? ?? PHP? ?? ?? ?? ? ?? ?? PHP ?? ??? ? ?? ????? ?? Jul 25, 2025 pm 08:30 PM

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

?? ?? ?? : ?? ?? ?????? PHP? ?? ?? ?? ?? : ?? ?? ?????? PHP? ?? Jul 27, 2025 am 04:31 AM

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

NGINX ? PHP ???? ??? ???? ?? MacOS? ???? PHP NGINX ??? ???? ?? NGINX ? PHP ???? ??? ???? ?? MacOS? ???? PHP NGINX ??? ???? ?? Jul 25, 2025 pm 08:24 PM

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

See all articles