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

php无限分类的类

<?php
/**
 by lenush;
 */
class Tree
{
    var $data    = array();
    var $child    = array(-1=>array());
    var $layer    = array(-1=>-1);
    var $parent    = array();
    function Tree ($value)
    {
        $this->setNode(0, -1, $value);
    } // end func
    function setNode ($id, $parent, $value)
    {
        $parent = $parent?$parent:0;
        $this->data[$id]            = $value;
        $this->child[$id]            = array();
        $this->child[$parent][]        = $id;
        $this->parent[$id]            = $parent;
        if (!isset($this->layer[$parent]))
        {
            $this->layer[$id] = 0;
        }
        else
        {
            $this->layer[$id] = $this->layer[$parent] + 1;
        }
    } // end func
    function getList (&$tree, $root= 0)
    {
        foreach ($this->child[$root] as $key=>$id)
        {
   


相关文档:

[转]PHP 中巧用数组降低程序的时间复杂度

PHP 中巧用数组降低程序的时间复杂度
王 丹丹, 高级软件工程师, IBM
2009 年 11 月 26 日
本文主要是介绍在 PHP 的编程中,如何巧用数组来降低因多层循环而引起的时间复杂度的问题。特别是当程序需要多次与数据库交互时,用此方法来优化你的代码,将会带给意想不到的效果。
通常开发人员在写程序的时候,往往是把已经设 ......

不错的php分布类

<?php
function genpage(&$sql,$page_size=10)
{
      global $pages,$sums,$eachpage,$page; //总页数,总记录,每页数,当前页
      $page = $_GET["page"];
   if($page ==0)$page =1;
      $eachpage = $page_s ......

php删除文件和整个文件夹

function delfile($dir)
{
if (is_dir($dir))
{
$dh=opendir($dir);
while (false !== ( $file = readdir ($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath))
{
unlink($fullpath);
} ......

php缓存心得

SQL查询缓存
适合读者
本教程适合于那些对缓存SQL查询以减少数据库连接与执行的负载、提高脚本性能感兴趣的PHP程序员。
概述
许多站点使用数据库作为站点数据存储的容器。数据库包含了产器信息、目录结构、文章或者留言本,有些数据很可能是完全静态的,这些将会从一个缓存系统中得到的极大好处。
这样一个系统通过把S ......

HTTPService与PHP通信

在Flex中有2个HTTPService类,它们的完整继承路径分别是mx.rpc.http和mx.rpc.http.mxml,可以看出mx.rpc.http.mxml是mx.rpc.http的子类。mx.rpc.http.mxml中的httpService主要是为了MXML标签中使用HTTPService而设的。mx.rpc.http是在使用as脚本进行操作时使用。当调用 HTTPService 对象的 send() 方法时,将发出对指定 URL ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号