易截截图软件、单文件、免安装、纯绿色、仅160KB

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获取时间差函数

//计算距公元1年1月1日的天数,$yyyy年分,$mm月份,$dd日
function datelocal($yyyy,$mm,$dd){
$monthdays = array(31,28,31,30,31,30,31,31,30,31,30,31); //非闰年的月份天数
//判断是否为闰年,闰年$leapyear = 1,否则 $leapyear = 0
if($yy%4==0 && $yyyy%100!=0 || $yyyy%400==0)
$leapyear = 1;
els ......

PHP分页代码

头部调用
 <?
require('conn.php');
$sql1="select id from news";
$query1=mysql_query($sql1,$conn);
$sun_num=mysql_num_rows($query1);
$gs=20;
$page_num=ceil($sun_num/$gs);
include("../subpage.php");
//传过来的页数参数
$PB_page=$_GET['PB_page'];
if ($PB_page==1 or empty($PB_page)){
$ ......

php 函数

htmlspecialchars()    
函数把一些预定义的字符转换为 HTML 实体。
      ENT_COMPAT - 默认。仅编码双引号。
          eg:" (双引号) 成为 &quot;
implode()    
函数把
数组元素组合为一个字 ......

php的session用法小结

 session是网站保存用户信息的一种手段,应用相当广泛。例如第五届排行榜就使用了session。经过对第五届排行榜的修改,我总结了一下php中session的用法。
(一)开始session
  在每一次使用session之前,都要加上这一句:“session_start();”。顾名思义,这个函数的作用就是开始使用session。
(二)注 ......

php 防注入攻击函数

/*php 防注入函数
string  $feifa  限制元素组成
如有非法字符跳转到上一页 返回 0  没有返回 1
*/
//使用方法
//$feifa=array("select","delete","from","update","create","destory","drop","alter" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号