Hey there,
PHP comes with a funky tool called variable variables.
They use the value of one variable as the name of another.
To use them, use '$$' instead of '$'.
eg.
for($=!; $i <= $numnames; $i++)
{
$temp= "name$i"; //The name of dynamic variable
echo $$temp."<br>"; //or whatever you want to do.
}
Then value of $name1,2,3,4 etc etc... will be used.
Hope this helps.