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 ×Ô¶¨Ò庯ÊýʵÏÖϵͳº¯Êý¹¦ÄÜ
×ÜÊÇÓñðÈËдºÃµÄº¯Êý ÊDz»ÊǾõµÃ²»Ë¬?ºÃ,ÏÂÃæ¸ú×ÅÎÒÀ´Ð´°É~~ÒÔÏ´úÂëÈ«²¿ÓÉ×Ô¼º±àд,¾øÎ޳Ϯ֮ÏÓ~~ÏÖÌùÉÏ,½ö¹©²Î¿¼.(¿ÉÄÜÓÐЩ¹¦ÄÜûÓÐдȫ)
˵Ã÷Ò»ÏÂ,дϵͳº¯ÊýÔÙÄÃÀ´Ê¹ÓÃȷʵºÜ´À,µ«Ö»ÊÇ×÷ΪÁ·Ï°,»¹ÓÐ,ÔÚÃæÊÔʱȷʵÊÇËã·¨¿¼µÃ¶à,ÍøÉÏÕÒÀ´µÄÃæÊÔÌâÒ²´ó¶¼Òª¿¿Ëã·¨\Óï·¨ÊìÁ·²ÅÄÜ ......
¡¡
¡¡PHP Ö§³Öcurlº¯Êý(ÔÊÐíÄãÓò»Í¬µÄÐÒéÁ¬½ÓºÍ¹µÍ¨²»Í¬µÄ·þÎñÆ÷). curl
ÊÇʹÓÃURLÓï·¨µÄ´«ËÍÎļþ¹¤¾ß£¬Ö§³ÖFTP¡¢FTPS¡¢HTTP HTPPS SCP SFTP TFTP TELNET DICT
FILEºÍLDAP¡£curl Ö§³ÖSSLÖ¤Êé¡¢HTTP POST¡¢HTTP PUT ¡¢FTP
ÉÏ´«£¬kerberos¡¢»ùÓÚHTT¸ñʽµÄÉÏ´«¡¢´úÀí¡¢cookie¡¢Óû§£«¿ÚÁîÖ¤Ã÷¡¢Îļþ´«Ëͻָ´¡¢http´úÀí ......
»ù±¾¸ÅÄî
PHP ÖеÄÊý×éʵ¼ÊÉÏÊÇÒ»¸öÓÐÐòͼ¡£Í¼ÊÇÒ»ÖÖ°Ñ values Ó³Éäµ½ keys µÄÀàÐÍ¡£Òò´Ë¼È¿ÉÒÔ°ÑphpµÄÊý×éµ±×öÆÕͨÊý×éʹÓã¬Ò²¿ÉÒÔÓÃËüÀ´Ä£Äâ×ֵ䡢¼¯ºÏ¡¢Õ»¡¢¶ÓÁС¢Ê÷µÈ¶àÖÖÆäËûÊý¾Ý½á¹¹¡£
Êý×éµÄ´´½¨£º
´´½¨Êý×éµÄÒ»°ã¸ñʽΪ£º$arrName = array( [key =>]value, ...)£¬ÆäÖÐkey ¿ÉÒÔÊÇ integer »òÕß string£¬¶øval ......
±¾ÈËÒÔǰûѧ¹ýphp£¬×î½ü¿´ÁËÒ»µãÕâ·½ÃæµÄ¶«Î÷£¬ËæÊÖдÁ˵ã´úÂ룬Àí½âphp»ù±¾Óï·¨µÄÓ÷¨¡£Ïȷŵ½ÍøÉÏ£¬ÒÔºóÈç¹û¼ÌÐøÑ§¾ÍÔÙ²¹³ä°É¡£Ê¹ÓõÄʱºòÐèÒªÏȽ«Îļþhelloworld.php¿½±´µ½ÍøÒ³·þÎñÆ÷µÄ¸ùĿ¼Ï£¨ÀýÈçapacheµÄhtdocs£©¡£È·±£apache¿ÉÒÔÓã¬È»ºó·ÃÎÊ£ºhttp://localhost/helloworld.php¾Í¿ÉÒÔ¿´µ½Ò³ÃæÉú³ÉµÄЧ¹û£¬ÁíÍâÁ½¸ ......