<?php
$produto_1 = "PROD1";
$produto_2 = "PROD2";
$produto_3 = "PROD3";
$limite = 3;
$update = "";
for ($passo = 1; $passo <= $limite; $passo++) {
$update .= "CODIGO = '" . ${"produto_$passo"} . "' AND ";
}
echo $update;
PD9waHAKCiRwcm9kdXRvXzEgPSAiUFJPRDEiOwokcHJvZHV0b18yID0gIlBST0QyIjsKJHByb2R1dG9fMyA9ICJQUk9EMyI7CgokbGltaXRlID0gMzsKJHVwZGF0ZSA9ICIiOwoKZm9yICgkcGFzc28gPSAxOyAkcGFzc28gPD0gJGxpbWl0ZTsgJHBhc3NvKyspIHsKCSR1cGRhdGUgLj0gIkNPRElHTyA9ICciIC4gJHsicHJvZHV0b18kcGFzc28ifSAuICInIEFORCAiOwp9CiAKZWNobyAkdXBkYXRlOwo=