Home > Backend Development > PHP Tutorial > php foreach循环判断在改变值。坐等大神解决

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

WBOY
Release: 2016-06-06 20:34:08
Original
1020 people have browsed it

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

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

            }
        }
    }
</code>
Copy after login
Copy after login

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

回复内容:

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

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

            }
        }
    }
</code>
Copy after login
Copy after login

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

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template