I wish I had the opportunity to create dynamic variables of ways, my problem is that I had to make a mistake in my code and autoincrement does not work ...
If anyone has any clues to give me
PHP CODE
for ($i = 1; $i <= 100; ++$i) {
if($vars['entity']->question[$i] == 'yes') {
$vars['entity']->myvar[$i];
}
}
In other way, i want to transform
$vars['entity']->question1
$vars['entity']->question2
...
$vars['entity']->question100
to
$vars['entity']->question[$i]
Your loop has no side effects (other than to finish with $i == 100
). More specifically, the line
$vars['entity']->myvar;
does nothing. Did you intend to mutate myvar
in some way?