PHP生成静态页面的类
静态|页面
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文件信息的来源网页地址
var $time; //html文件信息填加时的时间
var $dirtype; //目录存放方式:year,month,,,,
var $nametype; //html文件命名方式:name
function html($nametype='name',$dirtype='year',$rootdir='html')
function setvar($nametype='name',$dirtype='year',$rootdir='html')
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))
}
}
}
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)
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;
//上面保证不重复地把变量赋予该类成员
if(empty($htmlname))
$this->getname();
else
$this->name=$dirname.'/'.$htmlname; //得到name
$content=file($this->url) or die("Failed to open the url ".$this->url." !");;
///////////////关键步---用file读取$this->url
$content=join("",$content);
name,"w'>$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)))
closedir($handle);
rmdir($file);
return true;
}else
}
}
}
?>

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











많은 사용자들이 스마트 시계를 선택할 때 Huawei 브랜드를 선택하게 됩니다. 그 중 Huawei GT3pro와 GT4가 가장 인기 있는 선택입니다. 두 제품의 차이점을 궁금해하는 사용자가 많습니다. Huawei GT3pro와 GT4의 차이점은 무엇입니까? 1. 외관 GT4: 46mm와 41mm, 재질은 유리 거울 + 스테인레스 스틸 본체 + 고해상도 섬유 후면 쉘입니다. GT3pro: 46.6mm 및 42.9mm, 재질은 사파이어 유리 + 티타늄 본체/세라믹 본체 + 세라믹 백 쉘입니다. 2. 건강한 GT4: 최신 Huawei Truseen5.5+ 알고리즘을 사용하면 결과가 더 정확해집니다. GT3pro: ECG 심전도, 혈관 및 안전성 추가

PHP 기능 소개 - get_headers(): URL의 응답 헤더 정보 얻기 개요: PHP 개발에서는 웹 페이지나 원격 리소스의 응답 헤더 정보를 얻어야 하는 경우가 많습니다. PHP 함수 get_headers()를 사용하면 대상 URL의 응답 헤더 정보를 쉽게 얻고 이를 배열 형식으로 반환할 수 있습니다. 이 기사에서는 get_headers() 함수의 사용법을 소개하고 관련 코드 예제를 제공합니다. get_headers() 함수 사용법: get_header

오류의 원인은 urllib3 라이브러리의 예외 유형인 NameResolutionError(self.host,self,e)frome입니다. 이 오류의 원인은 DNS 확인에 실패했기 때문입니다. 해결을 찾을 수 없습니다. 이는 입력한 URL 주소가 정확하지 않거나 DNS 서버를 일시적으로 사용할 수 없기 때문에 발생할 수 있습니다. 이 오류를 해결하는 방법 이 오류를 해결하는 방법은 여러 가지가 있습니다. 입력한 URL 주소가 올바른지 확인하고 액세스할 수 있는지 확인하십시오. DNS 서버를 사용할 수 있는지 확인하십시오. 명령줄에서 "ping" 명령을 사용해 볼 수 있습니다. DNS 서버를 사용할 수 있는지 테스트하려면 프록시 뒤에 있는 경우 호스트 이름 대신 IP 주소를 사용하여 웹사이트에 액세스해 보세요.

요즘에는 게임을 좋아하는 많은 Windows 사용자들이 Steam 클라이언트에 접속하여 좋은 게임을 검색하고 다운로드하여 플레이할 수 있습니다. 그러나 많은 사용자의 프로필이 정확히 동일한 이름을 가질 수 있으므로 프로필을 찾거나 Steam 프로필을 다른 제3자 계정에 연결하거나 Steam 포럼에 가입하여 콘텐츠를 공유하기가 어렵습니다. 프로필에는 고유한 17자리 ID가 할당되며, 이는 동일하게 유지되며 사용자가 언제든지 변경할 수 없는 반면, 사용자 이름이나 맞춤 URL은 변경할 수 있습니다. 그럼에도 불구하고 일부 사용자는 자신의 Steamid를 모르므로 이를 아는 것이 중요합니다. 계정의 Steamid를 찾는 방법을 모르더라도 당황하지 마세요. 이 기사에서는

차이점: 1. 정의가 다릅니다. url은 균일한 리소스 위치 지정자이고 html은 하이퍼텍스트 마크업 언어입니다. 2. html에는 여러 개의 URL이 있을 수 있지만 하나의 url에는 단 하나의 html 페이지만 존재할 수 있습니다. 웹 페이지이고 url은 웹 사이트 주소를 나타냅니다.

url을 사용하여 java.net.URLDecoder.decode(url, 디코딩 형식) 클래스 decoder.decoding 인코딩 및 디코딩 방법을 인코딩 및 디코딩합니다. 일반 문자열로 변환하는 URLEncoder.decode(url, 인코딩 형식)는 일반 문자열을 지정된 형식의 문자열로 변환합니다. packagecom.zixue.springbootmybatis.test;importjava.io.UnsupportedEncodingException;importjava.net.URLDecoder;importjava.net. URL인코더

Windows 11에서 캡처 도구가 작동하지 않는 이유 문제의 근본 원인을 이해하면 올바른 솔루션을 찾는 데 도움이 될 수 있습니다. 캡처 도구가 제대로 작동하지 않는 주요 이유는 다음과 같습니다. 초점 도우미가 켜져 있습니다. 이렇게 하면 캡처 도구가 열리지 않습니다. 손상된 응용 프로그램: 캡처 도구가 실행 시 충돌하는 경우 응용 프로그램이 손상되었을 수 있습니다. 오래된 그래픽 드라이버: 호환되지 않는 드라이버가 캡처 도구를 방해할 수 있습니다. 다른 응용 프로그램의 간섭: 실행 중인 다른 응용 프로그램이 캡처 도구와 충돌할 수 있습니다. 인증서가 만료되었습니다. 업그레이드 프로세스 중 오류로 인해 이 문제가 발생할 수 있습니다. 이 문제는 대부분의 사용자에게 적합하며 특별한 기술 지식이 필요하지 않습니다. 1. Windows 및 Microsoft Store 앱 업데이트

오늘은 golang time 패키지의 시간 적용 방법을 주로 살펴보겠습니다. 둘 사이의 일반적인 규칙은 "벽 시간"이 시간을 알려주는 데 사용되고 "단조 시계"가 시간을 측정하는 데 사용된다는 것입니다. 다른 시계 처리 방법이 있습니다.
