douqianxian7008 2015-10-07 04:45
浏览 35
已采纳

你能在php中按名称检索嵌套数组吗?

I have an array like this:

(
[data] => Array
    (
        [account_id] => 1
        [description] => my asset
        [value] => Estimate
        [value_amount] => 85000
        [type] => Vehicle
        [owner] => Array
            (
                [app_id] => 123
                [percent] => 100
            )
    )
)

Clearly I can loop through the array and pull out the nested owner array that way, but is there something similar to array_column that will get the entire owner nested array without having to loop ?

  • 写回答

2条回答 默认 最新

  • dongtuo6562 2015-10-07 04:49
    关注

    Use the indexes, no function necessary.

    $owner = $array['data']['owner']

    or..

    $percent = $array['data']['owner']['percent']

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目