简单的计算php页面处理时间
<?php
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
//例子
//开始
$time_start = getmicrotime();
//这里放你的代码
//结束
$time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Did nothing in $time seconds"; //输出运行总时间
?>
相关文档:
在PHP中有urlencode()、urldecode()、rawurlencode()、rawurldecode()这些函数来解决网页
URL编码解码问题。
在ASP的时候URL编码解码很是恼火,Server.urlencode不太好用,遇到utf-8编码的地址更是麻
烦。你要获取百度、Google点击到网站的网址链接中的关键字,要写上一堆自定义函数来得到urldecode的效果。
摘录一篇关 ......
1
<?
2
/*
*
3
* filename: ext_page.class.php
4
* @package:phpbean
5
* @author :feifengxlq<feifengxlq#gmail.com><[url=http://www.phpobject.net/]http://www.phpobject.net/[/url]>
& ......
正好工作中配到此类问题,写出来和大家分享。很多网友提供了使用urlencode 和 urldecode的方式去编码和解码,说的不全面。有的时候也会碰到这样的问题。
1.首先要检查你apache和php的服务器默认语言。在window下,可以参考apache的配置文件httpd.conf。 在AddCharset附近在加上下面的命令行:
AddDefaultCharset UTF-8
......
安装完php 和 apache后,如果apache 不支持 php
1.apache中没有 php加载模块。
在httpd.conf中加入。
LoadModule php5_module "c:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
如果 不能正常启动apache 可能是apache版 本的事。可以修改 LoadModule php5_module "c:/php5/php5apache2_2.dll"
&n ......