php数组堆栈排序
我正在尝试在 php 中对这个数组进行排序:
Array
(
[Levi Self] => Array
(
[0] => Portraits
[1] => Abstract
)
[Portraits] => Array
(
[0] => Megan
)
[Abstract] => Array
(
[0] => Locks
)
)
看起来像这样:
Array
(
[Levi Self] => Array
(
[Portraits] => Array
(
[0] => Megan
)
[Abstract] => Array
(
[0] => Locks
)
)
)
基本上,它删除了重复的项目“肖像”和“摘要”,因为它们已经是数组开始的键,并且是第一把钥匙,“利维·塞尔夫”。有什么办法可以做到这一点吗?谢谢,利维·塞尔夫
I am trying to sort this array in php:
Array
(
[Levi Self] => Array
(
[0] => Portraits
[1] => Abstract
)
[Portraits] => Array
(
[0] => Megan
)
[Abstract] => Array
(
[0] => Locks
)
)
To look like this:
Array
(
[Levi Self] => Array
(
[Portraits] => Array
(
[0] => Megan
)
[Abstract] => Array
(
[0] => Locks
)
)
)
Which, basically, removes the duplicate items "Portraits" and "Abstract", as they are already the keys for the array to begin with, along with being items under the first key, "Levi Self". Is there any way to do this? Thanks, Levi Self
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)