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 ' does not have this directory '. $path;
mkdir ($path, 0755);
}
}
return $filePath. $p;
}
function Start ()
{
Ob_start ();
}
Function End ()
{
$info = Ob_get_contents ();
$fileId = ' 12345 ';
$postfix = '. html ';
$path = $this->mkdir ($prefix = ' article ');
$fileName = Time (). ' _ '. $fileId. $postfix;
$file =fopen ($path. $fileName, ' W ');
Fwrite ($file, $info);
Fclose ($file);
Ob_end_flush ();
}
}
?>
$s =new createhtml ();
$s->start ();
?>
Asdfasdfasdfasdfasdfasdfasdfasdfasdf
Adfasdfasdf
>
$s->end ();
?>
http://www.bkjia.com/PHPjc/631968.html www.bkjia.com true http://www.bkjia.com/PHPjc/631968.html techarticle PHP class Createhtml {function mkdir ($prefix = ' article ') {$y = date (' y '); $m = Date (' m '); $d = Date (' d '); $p =dire Ctory_separator; $filePath = ' article '. $p. $y $p. $m. $p. $d; $a =exp ...