Skip to content

Commit 6a0d3c5

Browse files
Update README.md
1 parent 6f1a00f commit 6a0d3c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# array-tree
2-
带有树结构的数组(含parent_id)非递归转为包含层级的树结构数组
2+
带有树结构的数组(含parent_id)非递归生成包含层级的树结构数组
33

44
只是遍历了一遍所有数据,和指定父元素及其下所有子元素,未使用递归,理论上可以支持无限层级
55

@@ -44,7 +44,7 @@
4444
"name": "添加友情链接提交保存"
4545
}]
4646
47-
获取包含层级结构的数组
47+
生成包含层级结构的数组
4848

4949
ArrayTree::getTree($array,id); //$array 包含树结构关系的数组(需包含 id parent_id name),$id 父id ,会返回该父id下的所有子级元素(层级结构)
5050
结果如下:
@@ -96,7 +96,7 @@
9696
}]
9797

9898

99-
获取包含层级结构的数组,并添加名称路径
99+
生成包含层级结构的数组,并添加名称路径
100100

101101
ArrayTree::getTreePath($res,$id,$separator); //$array 包含树结构关系的数组(需包含 id parent_id name),$id 父id ,会返回该父id下的所有子级元素(层级结构),$separator 路径分隔符
102102
结果如下(分隔符是/,因转为json字符串添加了转义符,解码后是没有\的):

0 commit comments

Comments
 (0)