...

View Full Version : $_POST and array



meshhat
11-11-2007, 02:50 AM
I'm passing 100 variables (named gaintxt0, gaintxt1....gaintxt100) using a POST. I would like to put these variables into an array. However, I'm having trouble with the syntax for the $_POST.

I'm trying to do something like this, but it's not working:



<?
$myArray = array();

for($i=0; $i<=100; $i++){
array_push($myArray, $_POST[gaintxt[$i]]);
}

?>


Any ideas?

PappaJohn
11-11-2007, 03:04 AM
<?
$myArray = array();

for($i=0; $i<=100; $i++){
array_push($myArray, $_POST['gaintxt' . $i]);
}

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum