Ver originalforeach($result as $index => $value){ if($value != $params[$index]['1'][$index] $old .= $value; }