Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPÎÞÏÞÌݹé

<?php
class Tree
{
      //  public $data=array();//ËùÓнڵãÖµ
       // public $cateArray=array();//ËùÓи¸½Úµã
        function Tree()
        {
        }
        //setNode(Ŀ¼ID,Éϼ¶ID£¬Ä¿Â¼Ãû×Ö);
        function setNode ($id, $parent, $value){
        $parent = $parent?$parent:0;
        $this->data[$id] = $value;//»ñÈ¡µ±Ç°ID¶ÔÓ¦µÄµ±Ç°Ä¿Â¼Ãû
        $this->cateArray[$id] = $parent;//»ñÈ¡µ±Ç°ID¶ÔÓ¦µÄ¸¸·ÖÀàID
       //echo $id."->".$this->cateArray[$id]."--".$this->data[$id]."<br>";
        }
     function getChilds($id=0)
     {
            $childArray=array();
            $childs=$this->getChild($id);
            foreach ($childs as $child)
            {
                     $childArray[]=$child;
                     $childArray=array_merge($childArray,$this->getChilds($child));//id µÝ¹é ÀÛ¼Ó
            }
            return $childArray;
     }
     function getChild($id)
     {
 &nbs


Ïà¹ØÎĵµ£º

php array reader µÝ¹é±éÀú php Êý×é

<?php
/*
* -------------------------------------------------
* Author : Fanglor
* Email : Fanlor@163.com
* Url : www.skyleft.com
* Date : 2009-10-13
* -------------------------------------------------
*/
function arr_foreach ($arr) {
if (!is_array ($arr)) {
return fa ......

ÓÃphpµÄcÀ©Õ¹±à³Ìµ÷Óà c³ÌÐòµÄ¶¯Ì¬Á´½Ó¿â


Ò».    Ê×ÏÈ×öÒ»¸ö¼òµ¥µÄsoÎļþ£º
    /**
     * hello.c
     * To compile, use following commands:
     *   gcc -O -c -fPIC -o hello.o hello.c
     *   gcc -shared ......

PHPÈëÃÅÔ´Âë

±¾ÈËÒÔǰûѧ¹ýphp£¬×î½ü¿´ÁËÒ»µãÕâ·½ÃæµÄ¶«Î÷£¬ËæÊÖдÁ˵ã´úÂ룬Àí½âphp»ù±¾Óï·¨µÄÓ÷¨¡£Ïȷŵ½ÍøÉÏ£¬ÒÔºóÈç¹û¼ÌÐøÑ§¾ÍÔÙ²¹³ä°É¡£Ê¹ÓõÄʱºòÐèÒªÏȽ«Îļþhelloworld.php¿½±´µ½ÍøÒ³·þÎñÆ÷µÄ¸ùĿ¼Ï£¨ÀýÈçapacheµÄhtdocs£©¡£È·±£apache¿ÉÒÔÓã¬È»ºó·ÃÎÊ£ºhttp://localhost/helloworld.php¾Í¿ÉÒÔ¿´µ½Ò³ÃæÉú³ÉµÄЧ¹û£¬ÁíÍâÁ½¸ ......

phpÖлñÈ¡¸´Ñ¡¿òcheckboxÖµµÄÎÊÌâ

ÔÚ×öºªµ¦·¿²úÍøµÄʱºòÓöµ½php»ñÈ¡checkboxµÄÎÊÌ⣺asp»ñÈ¡±íµ¥Öеĸ´Ñ¡¿òµÄÖµ£¬Ö±½Ó¾ÍÊÇÒÔ“,”£¨¶ººÅ£©Îª·Ö¸ô·ûµÄÊý×é¡£phpÖÐÈ·×ÜÊÇÖ»»ñÈ¡×îºóÒ»¸ö¸´Ñ¡¿òµÄÖµ¡£
½â¾ö°ì·¨£º
form±íµ¥µÄ²¿·Ö´úÂ룺
<input type="checkbox" name="frm_tag[]" id="frm_tag" value="1">1
<input type="checkbox" name=" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ