<?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, '顶极节点'); $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

12Jul2016
A simple way to implement unlimited classification in PHP, unlimited classification in PHP. A simple method to implement unlimited classification in PHP, unlimited classification in PHP. This article describes an example of a simple method to implement infinite classification in PHP. Share it with everyone for your reference, the details are as follows: Database

13Dec2024
Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...
![PHP neutron class overloads the method of the parent class [parent::method name], neutron parent_PHP tutorial](/static/imghwm/default1.png)
12Jul2016
In PHP, the subclass overloads the method of the parent class [parent::method name], neutron parent. In PHP, a subclass overloads the method of the parent class [parent::method name]. The subclass parent cannot define functions with the same name in PHP, including methods with the same name that cannot be defined in the same class, so there is no

12Jul2016
PHP image upload class with calling method attached. The php image upload class is attached with the calling method. The example in this article is to share the php image upload class for your reference. The specific content is as follows. The calling method: phpheader("Content-Type:text/html; charse

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

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


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
