How to convert hidden form variables into an array
Posted: Mon Nov 25, 2002 6:24 pm
I am creating hidden form field variable names using a 'for' loop (example 1) on page1.php and it passes the variables through a form post to page2.php, so that when they are received by page2.php they are defined as $recipient1, $recipient2, etc...
My question, I have potentially 500 variables being sent via hidden form fields with the same naming convention, is there a way to dump the value of $recipient1 into $recipient[1] using a for loop or do i have to assign them individually.
EXAMPLE 1
<? for ($y=0; $y < count($data); $y++) { ?>
<input type="checkbox" name="recipient<? echo $y; ?>" value="<? echo $name; ?>">
<? } ?>
My question, I have potentially 500 variables being sent via hidden form fields with the same naming convention, is there a way to dump the value of $recipient1 into $recipient[1] using a for loop or do i have to assign them individually.
EXAMPLE 1
<? for ($y=0; $y < count($data); $y++) { ?>
<input type="checkbox" name="recipient<? echo $y; ?>" value="<? echo $name; ?>">
<? } ?>