数组转换为树

    /** * $sourceArr 原来的数组 * $key 主键 * $parentKey 与主键关联的父主键 * $childrenKey 生成的孩子的键名 * */ function arrayToTree($sourceArr, $key, $parentKey, $childrenKey) { $tempSrcArr = array(); foreach ($so
相关文章
相关标签/搜索