php获取程序执行的时间
在head.htm中加入,也就是在默认模版中添加“$stime=microtime(true); //获取程序开始执行的时间”
句
<!--<?php
$stime=microtime(true); //获取程序开始执行的时间
$GuideFid[$fid]=str_replace("<a href='$webdb[www_url]' class='guide_menu'>>首页</a>","",$GuideFid[$fid]);
$fupId=intval($fupId);
$topMenu[$fupId]='ck';
print <<<EOT
-->
这里是网页
再在foot.htm修改如:
<!--
EOT;
$etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime; //计算差值
echo "<br />[页面执行时间:{$total} ]秒";
?>
相关文档:
现在有很多的rss订阅,我们直接可以订阅到邮箱。既然学了PHP,那么有没有一种方法可以直接将rss的新闻信息显示在自己的网页上呢?有的,必须的,下面就是这个rss脚本:
<?php
//RSS源地址列表数组
$rssfeed = array("http://blog.csdn.net/heavenopener/category/668064.aspx/rss");
for($i=0;$i<sizeof($rssfee ......
最近想安装PEAR(PHP Extension and Application Repository),但是在执行批处理文件go-pear.bat的时候出现了错误:
phar "C:\php\PEAR\go-pear.phar" does not have a signature
PHP Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: ......
在项目开发中发现对php的文档缺少管理,别人写了一个,功能不多
<?php
/**
* 类名: doc
*
描述: 文档生成类
* 其他: 可以对目录进行过滤,设置好源目录后,请用绝对路径指定生成目录,模式可调,模式
*
1为常规类型,即以 斜线**开头,以*斜线 结束
* 2为扩展类型,凡是 斜线*开头以*斜线 结束的部分都将成为文 ......
一. 首先是PHP网页的编码
1. php文件本身的编码与网页的编码应匹配
a. 如果欲使用gb2312编码,那么php要输出头:header(“Content-Type: text/html; charset=gb2312"),静态页面添加<meta http-equiv="Cont ......
/*php 防注入函数
string $feifa 限制元素组成
如有非法字符跳转到上一页 返回 0 没有返回 1
*/
//使用方法
//$feifa=array("select","delete","from","update","create","destory","drop","alter" ......