作者:庾事镁 | 来源:互联网 | 2018-07-16 21:06
ec(2);classCreateHtml{ *functionmkdir($prefixarticle){ $ydate(Y); $mdate(m); $ddate(d); $pDIRECTORY_SEPARATOR;
class CreateHtml{
/*function mkdir($prefix= 'article' ){
$y = date('Y');
$m = date('m');
$d = date('d');
$p=DIRECTORY_SEPARATOR;
$filePath='article'.$p.$y.$p.$m.$p.$d;
$a=explode($p,$filePath);
foreach ($a as $dir){
$path.=$dir.$p;
if(!is_dir($path)){ //echo '没有这个目录'.$path;
mkdir($path,0755);
}
}
return $filePath.$p;
}*/
function start(){
ob_start();
}
function end($name){
$info = ob_get_contents();
$fileId = $name;
$postfix = '.html';
//$path = $this->mkdir($prefix= 'article');
$fileName = $fileId.$postfix;
//$file=fopen($path.$fileName,'w+');
$file=fopen($fileName,'w+');
fwrite($file,$info);
fclose($file);
ob_end_flush();
}
}
?>