数组中的层次结构 (php) ->如何获得父母?
我有一个数组层次结构,我想知道如何从子级“移动”到父级。 有没有更好的方法来使用 php 和层次结构?
我想避免对每个需要检查父母的孩子使用递归步骤。
有没有类似的课程或者类似的课程?与 xml 一样吗?
I have a hierarchy in array and i'd like to know how can i "move" from children to parent.
Is there a better way to work with php and hierarchy?
I'd like to avoid using recursive steps for each child i need to check a parent.
Is there a class or something similar? As exists with xml?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spl 带有各种数据结构。也许您正在寻找其中之一: https://www.php.net /manual/en/spl.datastructs.php
Spl comes with various data structures. Perhaps you are looking for one of them : https://www.php.net/manual/en/spl.datastructures.php