You could use "variable variables" in this situation, but why? Why are you using all these millions of different variables with numbers tacked on the end instead of an ARRAY?
There's no advantage to
$variable1, $variable2
over
$variable[1], $variable[2]
plus your "if" statement is a cinch like that.