Two arrays in foreach loop

后端 未结 22 1781
不思量自难忘°
不思量自难忘° 2020-11-22 04:48

I want to generate a selectbox using two arrays, one containing the country codes and another containing the country names.

This is an example:

22条回答
  •  没有蜡笔的小新
    2020-11-22 05:51

    You should try this for the putting 2 array in singlr foreach loop Suppose i have 2 Array 1.$item_nm 2.$item_qty

     `
    
    
      @foreach (array_combine($item_nm, $item_qty) as $item_nm => $item_qty)
    
    Sr.No item_nm item_qty
    $i++ $item_nm $item_qty
    @endforeach `

提交回复
热议问题