Jump to content

[SOLVED] Simple but can't get it


Stephen68

Recommended Posts

Sorry to bug you guys for this but I must be having mind freeze today :(

 

I'm looping through an $_POST[] value and I'm trying to add it to an array. There is some code at the

first of this that tells me how many of the value there are that I get from a hidden form value. Anway

this is the code I'm using to get the values into an array.

 

<?php

for ($i = 1; $i <= $numAnimal; $i++) {
$arrayAnimal[] = $_POST['animal_$i'];
}

?>

 

Ok what I'm trying to store in the array if the value of

 $_POST['animal_1'] 

The above does loop but it stores an empty value, any help would be great.

 

Stephen

Link to comment
https://forums.phpfreaks.com/topic/159869-solved-simple-but-cant-get-it/
Share on other sites

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.