Page 1 of 1

form values into an array

Posted: Sat Dec 11, 2004 5:11 am
by cto1mac
I have a client that has a huge form (60+ values) is there any way to make a script that will take all of those form values and put them into an array??

Thanks

Posted: Sat Dec 11, 2004 5:14 am
by kettle_drum

Code: Select all

$myOwnArray = $_POST;
$myOwnArray = $_GET;
??

Posted: Sat Dec 11, 2004 5:20 am
by cto1mac
so will creating the array this way keep me from having to manually enter:

Code: Select all

<?php
$myArr = array('$_POST[var1]', '$_POST[var2]'.....);

?>
it will do that for me??

Posted: Sat Dec 11, 2004 5:28 am
by kettle_drum
Yeah. It will copy everything that is in $_POST.

Code: Select all

$myOwnArray = $_POST;
print_r($_POST);
print_r($myOwnArray);
Test it for yourself :)