简单的计算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"; //输出运行总时间
?>
相关文档:
//冒泡排序(数组中实现)
function bubble_sort($arr) {
$cnt = count($arr);
if($cnt<=0) return false;
for($i=0; $i<$cnt;$i++) {
for($j=$cnt-1; $j>$i;$j--) {
if($arr[$j]<$arr[$j-1]) {
$tmp = $arr[$j];
$arr[$j] = $arr[$j ......
<?php
function page ( $totalPage , $currentPage,$url ,$halfPer=5)
{
$total=$totalPage-1;
$re="<td><a href="\" mce_href="\""$url\" onclick=\"page=prompt('共{$totalPage}页\\n自定义跳转到第几页:','');if(page>0&&page<$total)location.href=this.href+'='+(page-1);r ......
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]>
& ......
作者:Martin Streicher, 软件开发人员, Pixel, Byte, and Comma
尽管编写一个 PHP 扩展并不是很困难,而 SWIG 的确进一步简化了这项任务,这主要是因为它自动化了结合 PHP 与 C 或 C++ 所需的工作。若给定对一个函数的描绘 — 函数的名称及其形参 — SWIG 就会生成一个包装程序来将 PHP 与低层代码连接起来。
......
< type="text/javascript">
smarty 可以生成,
其实生成的原理很简单
1、获取你动态页面得内容
2、写入静态文件
比如:
<?
//获取文件内容
$content=file_get_contents(http://www.www.com/viewPage.php?id=$id
);
//检查是否存在旧文件,有则删除
i ......