Forum Moderators: coopster

Message Too Old, No Replies

PHP, ive done this before but dont remember how

been about 2 years

         

ookamioni

6:41 am on Oct 1, 2008 (gmt 0)

10+ Year Member



I need an example of code that:

Has an array within a loop that receives its data from an outside form.

PHP_Chimp

7:21 pm on Oct 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Although I am not quite sure what you want maybe this will help.

$contents = [url=http://uk3.php.net/manual/en/function.array-values.php]array_values[/url]($_POST);

I dont really see that point in the above function...but it will take the $_POST array and stick it into the $contents array and give it a numeric index.

You may have to give an example of what you want to achieve; or maybe I'm just being a bit slow...

<edit>
Sorry just noticed that was your first post, so welcome along...and sorry for not having a better reply for you ;)

[edited by: PHP_Chimp at 7:22 pm (utc) on Oct. 1, 2008]

grallis

10:41 pm on Oct 2, 2008 (gmt 0)

10+ Year Member



Hi ookamioni -

I'm with PHP_CHIMP ... not sure why you would want to dump the contents of the $_POST array into another array ... is it that you forgot or didnt know about the $_POST array? If not, message back and I'll gladly explain :)

eelixduppy

11:11 pm on Oct 2, 2008 (gmt 0)



the $_POST or $_GET superglobal arrays is where you'll find the data depending on your form method. There is no need to use array values unless you want to iterate through the POSTed array with a counter instead of using the names as the index.

And Welcome to WebmasterWorld, ookamioni! :)