How is possible to unite two variables for an if() structure?
for ($i = 1; $i <= 6; $i++)
{
if ($language_$i != ""){
print "bla bla bla";
}
of course this doesn´t work but it is what I mean..
[SOLVED] merging two variables for if() structure
Moderator: General Moderators
YESSSSS!!
NOW I GOT IT!
HERE IS THE CODE FOR EVERYBODY!
The language and level variables come from a selection form.
In that form, instead of writing the same code 6 times to make 6 lists
there´s a loop which creates 6 the same lists with different name variable
which is name=\"language_$i\" So with this piece of code I can
process all forms at same time.
for ($i = 1; $i <= 6; $i++)
{
$selected_language = ${'language_'.$i};
if ($selected_language)
{
.....
}
}
NOW I GOT IT!
HERE IS THE CODE FOR EVERYBODY!
The language and level variables come from a selection form.
In that form, instead of writing the same code 6 times to make 6 lists
there´s a loop which creates 6 the same lists with different name variable
which is name=\"language_$i\" So with this piece of code I can
process all forms at same time.
for ($i = 1; $i <= 6; $i++)
{
$selected_language = ${'language_'.$i};
if ($selected_language)
{
.....
}
}