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

PHP计算页面执行时间

run_time.php  Code:
<?php
class runtime
{
var $StartTime = 0;
var $StopTime = 0;
function get_microtime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
function start()
{
$this->StartTime = $this->get_microtime();
}
function stop()
{
$this->StopTime = $this->get_microtime();
}
function spent()
{
return round(($this->StopTime - $this->StartTime) * 1000, 1);
}
}
?>
return_time_test.php  Code:
<?php
include ('run_time.php');
$runtime = new runtime;
$runtime->start();
$a = 0;
for ($i=0;$i&ltrim(1000000);$i++){
$a += $i;
}
$runtime->stop();
echo "页面执行时间:".$runtime->spent()."毫秒!";
?>


相关文档:

PHP 中 global 变量用法

  PHP中的变量也有访问域。作用域可以使用PHP中global
  在函数内部、对象中和类中定义的局部变量在函数外部是无法被访问到的;同理,在函数外部、对象外和类外定义的变量,如果没有被传入,也是无法被访问到的。
  但是如果一个很多变量要同时被传入很多函数、对象或者类,我们也可以直接将其全局化。这样不仅可以 ......

php表格(test)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type = "text/css">
        &nbs ......

PHP验证码生成脚本(5位数字png格式)


<?php
header("Content-Type:image/png");
srand((double)microtime()*1000000);
$img_height=20;
$img_width=60;
$im=@imagecreate($img_width,$img_height) or die("不能初始化GD文件流");
$background_color=imagecolorallocate($im,255,255,255);
$text_color=imagecolorallocate($im,233,14,91);
......

[PHP]Pear的使用

1. PEAR的安装, 这里介绍利用PHP5自带的BAT文件安装,需要能上网。
   a. 在PHP5目录下找到go-pear.bat,双击安装(保证能上网, 以便下载),BAT自动从网上下载PEAR所需的东西;
   b. 按照提示输入一些设置信息,主要是要把局域网的网关加上,如http://192.168.0.1:80/ , pear要用这个地址访问Interne ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号