数组中的层次结构 (php) ->如何获得父母?

发布于 2024-12-06 02:43:55 字数 125 浏览 2 评论 0原文

我有一个数组层次结构,我想知道如何从子级“移动”到父级。 有没有更好的方法来使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水水月牙 2024-12-13 02:43:55

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文