<? Php
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 'This directory does not exist'. $ path;
Mkdir ($ path, 0755 );
}
}
Return $ filePath. $ p;
}
Function start ()
{
Ob_start ();
}
Function end ()
{
$ Info = ob_get_contents ();
$ FileId = '000000 ';
$ Postfix = '.html ';
$ Path = $ this-> mkdir ($ prefix = 'Article ');
$ FileName = time (). '_'. $ fileId. $ postfix;
$ File = fopen ($ path. $ fileName, 'w ');
Fwrite ($ file, $ info );
Fclose ($ file );
Ob_end_flush ();
}
}
?>
<? Php
$ S = new CreateHtml ();
$ S-> start ();
?>
<Html>
<Body>
Asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf <br>
Adfasdfasdf <br>
</Body>
</Html>
<? Php
$ S-> end ();
?>