How can I get the current array index in a foreach loop?

前端 未结 10 1728
陌清茗
陌清茗 2020-12-14 06:19

How do I get the current index in a foreach loop?

foreach ($arr as $key => $val)
{
    // How do I get the index?
    // How do I get the fir         


        
10条回答
提交回复
热议问题