求教: 用什么函数取得服务器的毫秒级时...
求教: 用什么函数取得服务器的毫秒级时间呀?
作者 lsqzhj 发布于 0000-00-00 分类:php基础编程
这个问题好像我提出过,可至今我还没有得到答案。
我只想要个思想。当然我不拒绝源代码
谢谢大家了。
我查资料也查询不到。好多都是软件,然后自己安装的。
但我只想要PHP代码。
逛论坛交流:自动生成HTML文件
我看了,原来PHP的模板还需要要安装吧。
我还以为是自己写出个模板来呢。
上QQ
faint ,搜啊 php+模板 一堆啊
使用模板就很简单。
给你贴个样子
[php]
<?php
include("datafile/dataconnect.php");
include "Templates/class.FastTemplate.php3";
$query="select title,url,articleid,type,comment from articles where type=1 order by click DESC limit 25";
//echo$query;
$result=mysql_db_query($dbname,"$query");
$rows=mysql_num_rows($result);
$leftnavi="";
for($i=0;$i<$rows;$i++){
mysql_data_seek($result, $i);
$content=mysql_fetch_array($result);
$leftnavi.="
";
};
$leftnavi="
$content[0]
";
//echo$leftnavi;
$query2="select title,url,articleid,type,comment,date from articles where type=1 order by articleid DESC ";
$result2=mysql_db_query($dbname,"$query2");
$rows2=mysql_num_rows($result2);
for($h=0; $h<$rows2; $h++) {
mysql_data_seek($result2, $h);
$content2=mysql_fetch_array($result2);
$filename = "article/$content2[2]";
//echo$filename;
$fd = fopen($filename, "r+" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
$tpl = new FastTemplate( dirname($PATH_TRANSLATED)."/Templates");
$tpl->define(array(http => "http.tpl",body => "body.tpl",leftnavi=> "leftnavi.tpl"));
$tpl->assign(LISTTABLE, $leftnavi);
$tpl->parse(LEFTNAVI, "leftnavi");
$tpl->assign(ARTTITLLE, $content2[0]);
$tpl->assign(ARTCONTENT, $contents);
$tpl->assign(PUBTIME, $content2[5]);
$tpl->parse(BODY, "body");
$tpl->assign(TITLE, "随渊心语
$leftnavi
content2[0]");
$tpl->parse(HTML, "http");
$tpl->parse(HTML, "http");
//$tpl->FastPrint(HTML);
$htmlcontent = $tpl->fetch("HTML");
$filepath="article/$content2[2].html";
$fp = fopen($filepath,"w"); //建立文件
$write=fputs($fp,$htmlcontent);
fclose($fp);
}
[/php]
?>
我写了那么一个文件,可我觉的太麻烦呀。
有没有简单点的办法!!
5555555555
没人理我!!
就是将放在变量力的写入文件,看手册fopen等
顶!顶!!!
8 条回复
回复