<?PHP header("Content-type: text/html; charset=utf-8"); $link = mysql_connect('localhost','root','eric') or die(mysql_error()); mysql_select_db('sortclass',$link); class SortClass{ var $data = array(); var $child = array(-1=>array()); var $layer = array(-1=>-1); var $parent = array(); var $link; var $table; function SortClass($link, $table){ $this->setNode(0, -1, '頂極節(jié)點(diǎn)'); $this->link = $link; $this->table = $table; $node = array(); $results = mysql_query('select * from '.$this->table.'',$this->link); while($node = mysql_fetch_assoc($results)){ $this->setNode($node['cid'],$node['pid'],$node['cname']); } }
This is an implementation library for PHP infinite splitting, with two methods: recursive and non-recursive. Friends who need it can download it and use it.
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article

13 Dec 2024
Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...

23 Jul 2025
function is an independent function, suitable for general functions; method is part of the class, suitable for encapsulating object behavior. Function can be called directly, with global scope, cannot access class attributes, does not support object-oriented features, and is suitable for small scripts; method needs to be called through objects or classes, belongs to the class, can access private attributes, supports inheritance polymorphism, and is suitable for large project structures. Function or method should be used according to whether the status and encapsulation are required.

28 Oct 2024
Suppression of Tensorflow Debugging OutputTensorflow prints extensive information about loaded libraries, found devices, and other debugging data...

01 Nov 2024
Obtaining Class Name from Extended PHP Class Static CallIn object-oriented programming, classes often extend base classes to inherit and extend...

03 Jan 2025
Overflow: Hidden and Expansion of HeightjQuery distinguishes itself from other JavaScript libraries through its cross-platform compatibility and...

01 Nov 2024
Retrieving Class Name from Static Calls in Extended PHP ClassesProblem:A PHP class hierarchy exists, with a base class Action and an extended...


Hot Tools

PHP library for dependency injection containers
PHP library for dependency injection containers

A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking

Small PHP library for optimizing images
Small PHP library for optimizing images
