Is there a way to contruct a variable, if I have these stored variables
$var_1 = 3;
$var_2 = 5;
$var_3 = 3;
$variable = 'var_';
$number = 1;
and I need to have a function that runs
while (something){
do something
while ($var_1 > 0){ // this is what I am trying to construct
do something
}
}
where you see the comment I want to make it so the code runs the first time and it uses $var_1 the second time it uses $var_2 etc…
I was trying to construct a variable like this
$var_1 = 3;
$var_2 = 5;
$var_3 = 3;
$variable = 'var_';
$number = 1;
$currentvar = $variable . $number;
and I need to have a function that runs
while (something){
do something
while ($var_1 > 0){ // this is what I am trying to construct
do something
}
}
and then put increments to the $number variable but how can I amke it so I can use it as a variable instead of a string? is this possible?