易截截图软件、单文件、免安装、纯绿色、仅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超级全局变量总结




重要的PHP超级全局变量总结

2008-07-14 16:53:03
 标签:全局变量
   [推送到技术圈
]
        PHP有9个预定义变量数组,分别总结如下:
 
1、$_SERVER
       
$_SERVER超级全局变量包含由web服务器创建的信息 ......

PHP 实现查询结果动态组合输出

      数据库中查询到以下的结果:
     cname      linename    minute
     aa              c1      & ......

PHP统计网站访问次数防刷新

<?
@session_start();
$counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['jingyun'])
{
$_SESSION['jingyun'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
}
?>
总访问 <span style="font-size:14px; color:#FF6600" mce_sty ......

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中文乱码解决办法


一.         首先是PHP网页的编码
1.     php文件本身的编码与网页的编码应匹配
a.     如果欲使用gb2312编码,那么php要输出头:header(“Content-Type: text/html; charset=gb2312"),静态页面添加<meta http-equiv="Cont ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号