PHP implements stepless recursive classification (ThinkPHP framework) * ** stepless recursive classification * @ paramint $ assortPid: parent id of the category to be queried * @ parammixed $ delimiter between the upper and lower levels of the tag * @ returnstring $ tree returned classification tree structure result ** implement stepless recursive classification in func PHP (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 ;}