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} ]秒";
?>
相关文档:
重要的PHP超级全局变量总结
2008-07-14 16:53:03
标签:全局变量
[推送到技术圈
]
PHP有9个预定义变量数组,分别总结如下:
1、$_SERVER
$_SERVER超级全局变量包含由web服务器创建的信息 ......
htmlspecialchars()
函数把一些预定义的字符转换为 HTML 实体。
ENT_COMPAT - 默认。仅编码双引号。
eg:" (双引号) 成为 "
implode()
函数把
数组元素组合为一个字 ......
一. 首先是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" ......