Jump to content

[SOLVED] switching from foreach to for, error???


darksniperx

Recommended Posts

if($_POST['submit'])
{
/*comment code temporarely
foreach($_POST['name'] as $value)
{
	echo $value;
}
*/
$name = $_POST['name'];
$email = $_POST['email'];
$website = $_POST['website'];
for($posion = 0; $position < count($name); $position ++)
{
	echo $name[$position] . " : - : " . $email[$position] . " : - : " .$website[$position] ."\n";
}
}

 

when I use for each everything works and I get output, the problem, it works only with one variable. Since I have to work with 3 variables arrays I have switched to for look, but I get no output???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.