<?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 '没有这个目录'.$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();
}
}
?>
<?php
$s = new CreateHtml();
$s->start();
?>
<html>
<body>
asdfasdfasdfasdfasdfasdfasdfasdfasdf<br>
adfasdfasdf<br>
</body>>
</html>
<?php
$s->end();
?>
响应式博客资讯类会员投稿网站模板安装即用,自带人人站CMS内核及企业站展示功能,支持响应式,前端banner轮播图文本均已进行可视化配置,伪静态页面生成,支持内容模型、多语言、自定义表单、筛选、多条件搜索等功能。模板特点:1、安装即用,自带人人站CMS内核及企业站展示功能(产品,新闻,案例展示等),并可根据需要增加表单 搜索等功能(自带模板) 2、支持响应式 3、前端banner轮播图文本均已进行
0
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号