Unlimited classification is implemented, but tree charts such as root directory & nbsp; | ____ category 1 & nbsp; |-category 1 & nbsp; |-category 2 & nbsp; | ____ category 2 & nbsp; I have implemented the infinite classification by recursive method, but what should I do if I want to display it in the selection box ?, There are a lot of such things on the Internet, which implement unlimited classification, but want to display a tree chart
Such as the root directory
|____ Category 1
|-Class 1
|-Class 2
|____ Category 2
I have implemented the infinite classification method by recursion, but what should I do if I want to display it in the selection box like this?
------ Solution --------------------
There are a lot of such things on the Internet, looking for a lot
Http://www.oschina.net/code/snippet_99943_1452
------ Solution --------------------
PHP code
Foreach ($ result as $ res) {foreach ($ res as $ r) {if ($ r ['id'] = $ res ['id']) echo "|-small ". $ r ['id']."
";} Echo" |--large ". $ r ['id']."
";}
------ Solution --------------------
The same applies to the selection box. Embed the select control.
------ Solution --------------------
First, give the data you have obtained (as long as it is representative, no need for complete data)