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
function genpage(&$sql,$page_size=10)
{
global $pages,$sums,$eachpage,$page; //×ÜÒ³Êý£¬×ܼǼ£¬Ã¿Ò³Êý£¬µ±Ç°Ò³
$page = $_GET["page"];
if($page ==0)$page =1;
$eachpage = $page_s ......
set_magic_quotes_runtimeÊÇÓÃÀ´ÉèÖÃPHP »·¾³ÅäÖõıäÁ¿ magic_quotes_runtime Öµ¡£
0-¹Ø±Õ 1-´ò¿ª
³ÌÐòÖмì²â״̬ÓÃget_magic_quotes_runtime,·µ»Ø 0 ±íʾ¹Ø±Õ±¾¹¦ÄÜ£»·µ»Ø 1 ±íʾ±¾¹¦ÄÜ´ò¿ª¡£Èô
magic_quotes_runtime ´ò¿ªÊ±£¬ËùÓÐÍⲿÒýÈëµÄÊý¾Ý¿â×ÊÁÏ»òÕßÎļþµÈµÈ¶¼»á×Ô¶¯×ªÎªº¬Óз´Ð±ÏßÒç³ö×Ö·ûµÄ×ÊÁÏ¡ ......
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);
}
......
SQL²éѯ»º´æ
Êʺ϶ÁÕß
±¾½Ì³ÌÊʺÏÓÚÄÇЩ¶Ô»º´æSQL²éѯÒÔ¼õÉÙÊý¾Ý¿âÁ¬½ÓÓëÖ´ÐеĸºÔØ¡¢Ìá¸ß½Å±¾ÐÔÄܸÐÐËȤµÄPHP³ÌÐòÔ±¡£
¸ÅÊö
Ðí¶àÕ¾µãʹÓÃÊý¾Ý¿â×÷ΪվµãÊý¾Ý´æ´¢µÄÈÝÆ÷¡£Êý¾Ý¿â°üº¬Á˲úÆ÷ÐÅÏ¢¡¢Ä¿Â¼½á¹¹¡¢ÎÄÕ»òÕßÁôÑÔ±¾£¬ÓÐЩÊý¾ÝºÜ¿ÉÄÜÊÇÍêÈ«¾²Ì¬µÄ£¬ÕâЩ½«»á´ÓÒ»¸ö»º´æÏµÍ³Öеõ½µÄ¼«´óºÃ´¦¡£
ÕâÑùÒ»¸öϵͳͨ¹ý°ÑS ......