What is an infinite class classification?
Infinite class classification is a kind of classification skills, such as departmental organization, article classification, subject classification, etc.
It would be nice to simply interpret it as a classification. In fact, we think about it, the classification of life is simply too much,
Clothes can be divided into men's and women's clothing, can also be divided into tops and trousers, can also be classified according to age.
Classification is everywhere, the classification appears "infinite". I'm not talking about the need for infinite categorization here.
Introduction to the principle of infinite class classification
Infinite classification needs not only the subtlety of code, but also the rationality of database design.
To satisfy an infinite class classification, the database needs to have two required field id,pid.
The ID is used to identify itself, and the PID is used to indicate the parent ID.
That is, each classification record not only describes itself, but also describes another ID that is most closely related to it.
PHP Implements Infinite class classification (recursive method)