1
I am developing a PHP system with Oracle and to "optimize" an update, I would need to concatenate a variable (with values from 1 to 3) in the name of the variable that I will pass in the instruction. The variables come from a form, and I need to pass one by one, without using array.
Below is a passage that is today:
$update .="CODIGO = '$produto_1' AND ";
The above example would need to pass something like this, where the $passo
would have fixed values (today from 1 to 3):
$update .="CODIGO = '$produto_.$passo' AND ";
In that case I should pass as variable too $produto_1
, afterward $produto_2
......
Using the point to concatenate didn’t work. Any hints?
Wow it’s true, I’ve rarely used it, but it works perfectly.
– Guilherme Nascimento
@Guilhermenascimento da para usar para chamada de funções também :D
– Guilherme Lautert
Is practically the
eval
then :/– Guilherme Nascimento
@Guilhermenascimento not exactly, would be almost a
$$nameVar
– Guilherme Lautert