当前位置:Gxlcms > PHP教程 > phpforeach循环判断在改变值。坐等大神解决

phpforeach循环判断在改变值。坐等大神解决

时间:2021-07-01 10:21:17 帮助过:3人阅读

    foreach ($gjtc as $key=>$val)
    {
        foreach ($gjtc2 as $key2=>$vals2)
        {
            if($key['order_id']==$key2['order_id'])
            {

            }
        }
    }

写到这里不会写了,我要把2数组sp_tc相加根据1组的ID

回复内容:

    foreach ($gjtc as $key=>$val)
    {
        foreach ($gjtc2 as $key2=>$vals2)
        {
            if($key['order_id']==$key2['order_id'])
            {

            }
        }
    }

写到这里不会写了,我要把2数组sp_tc相加根据1组的ID

直接用sql语句操作就好了,为什么还要php写循环去操作呢?

人气教程排行