Sorry. My mistake. What I did was pare my code down and didn't get it right.
Actually it would be more along the lines the way it is below.
For example, one set of the variables might be pots, pans, and skillets. Another set of variables might be forks, spoons, and knives. In other words, each set of variables would have a different name each time.
I hate to waste everybody's time due to my ineptitude at explaining the problem. I've got a book, "Sam's Teach Yourself PHP 4 in 24 Hours". The book says what I've got is a "Multidimentional Array."
According to the book, if I'm reading it right, I need two foreach statements. Sam's book solution is down at the bottom below:
<form action="SecondPage.php" method="post">
if ($First == "Y"){
<input type="radio" name="Variable"."[$a]" value="Y" checked>
<input type="radio" name="Variable"."[$a]" value="N">
}else{
<input type="radio" name="Variable"."[$a]" value="Y">
<input type="radio" name="Variable"."[$a]" value="N" checked>
}
if ($Second == "Y"){
<input type="radio" name="Variable"."[$b]" value="Y" checked>
<input type="radio" name="Variable"."[$b]" value="N">
}else{
<input type="radio" name="Variable"."[$b]" value="Y">
<input type="radio" name="Variable"."[$b]" value="N" checked>
}
if ($Third == "Y"){
<input type="radio" name="Variable"."[$c]" value="Y" checked>
<input type="radio" name="Variable"."[$c]" value="N">
}else{
<input type="radio" name="Variable"."[$c]" value="Y">
<input type="radio" name="Variable"."[$c]" value="N" checked>
}
</form>
// Sam's "Teach Yourself PHP 4 In 24 Hours" solution - this one works ok.
$characters = array (
array (name => "bob", occupation=> "superhero", age=> 30, specialty=> "x-ray vision"),
array (name => "sally", occupation=> "superhero", age=> 24, specialty=> "superhuman strength"),
array (name => "mary", occupation=> "arch villain", age=> 63, specialty=> "nanotechnology")
);
foreach ($characters as $val)
{
foreach ($val as $key=>$final_val)
{
echo "$key: $final_val<br>";
}
echo "<br>";
}