dongyi0210 2018-02-18 17:27
浏览 45

PHP foreach循环不同的数组

I have one array which I am looping with foreach and then within this loop I am looping another array. I display the result but I get all values from the second array within each loop of the first....

So if I have 3 items from 1st array looping at 1st foreach will be displayed ok but in the part of the 2nd foreach, I will have repeated data from 2nd array, instead of single.

Can you please assist, drive my thinking? Thank you

    "description": {
        "EN": {
            "headline": "artment in Malmö city",
            "summary": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,",
            "description": "Lorem Ipsum " 
        },
        "DA": {
            "headline": "3 værelses lejlighed i Malmø by",
            "summary": "Lorem Ipsum er simpelthen dummy tekst af t",
            "description": "Lorem Ipsum er simpelthen " 
        },
  • 写回答

1条回答 默认 最新

  • douyu7879 2018-02-18 19:54
    关注

    it is very obvious that 2nd foreach loop will get full executed on every execution of 1st foreach loop

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度