php 静态文件生成类(自家用)
2011-11-19 11:29
621 查看
简介:这是php 静态文件生成类(自家用)的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=324386' scrolling='no'>
<?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();
?>
“php 静态文件生成类(自家用)”的更多相关文章 》
爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具
http://biancheng.dnbcw.info/php/324386.html pageNo:15
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=324386' scrolling='no'>
<?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();
?>
“php 静态文件生成类(自家用)”的更多相关文章 》
爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具
http://biancheng.dnbcw.info/php/324386.html pageNo:15
相关文章推荐
- php 静态文件生成类(自家用)
- PHP缓存类(可生成静态文件,FROM多菜鸟)
- 将PHP文件生成静态文件源码
- 谈PHP生成静态页面分析 模板+缓存+写文件
- php生成静态文件的方法
- php生成静态文件
- php静态文件生成类实例分析
- php生成静态文件的方法
- php生成静态文件
- PHP 批量生成静态文件目录代码
- php生成html静态文件
- php 静态文件生成类
- PHP中使用smarty生成静态文件的例子
- PHP中实现生成静态文件之简单方法一
- php静态缓存学习-2.使用模板文件生成静态html
- PHP生成静态文件
- 谈PHP生成静态页面分析 模板+缓存+写文件
- PHP生成HTML静态文件
- PHP中实现生成静态文件的方法缓解服务器压力
- php动态程序生成静态文件示例