: This article mainly introduces PHP's implementation of stepless recursive classification (ThinkPHP framework). If you are interested in PHP tutorials, please refer to it.
PHP implements stepless recursive classification (ThinkPHP framework ):
/*** Stepless recursive classification ** @ param int $ assortPid the parent id of the category to be queried * @ param mixed $ delimiter between the upper and lower levels of the tag * @ return string $ tree returned Category tree structure result **/function recursiveAssort ($ assortPid, $ tag = '') {$ assort = M ('goods _ class')-> where (" class_pid = $ assortPid ")-> field ('class _ id, class_name ')-> select (); foreach ($ assort as $ value) {$ tree. =''. $ Tag. $ value ['class _ name'].''; $ Tree. = recursiveAssort ($ value ['class _ id'], $ tag. 'category');} return $ tree ;}
The above is the content of PHP's implementation of stepless recursive classification (ThinkPHP framework). For more information, see PHP's Chinese website (www.php1.cn )!