i have large form that i want to send in mail using php, although i can send it with request['name'] i have to write it more than 50 times in message variable, what i want to do how i can add the keys and values to message variable with some filteration that i want to omit submit request variable
A:
Doesn't foreach do exactly that ?
foreach (filter_var_array($_REQUEST, ..) as $key => $value) {
echo $key.' => '.$value."\n";
}
Of course don't forget to filter the data itself.
Lepidosteus
2009-05-21 21:02:22
+1
A:
I would make a copy of the variable, delete the submit
element and then get the array declaration code with var_export
:
$array = $_REQUEST;
unset($array['submit']);
$text = var_export($array, true);
Gumbo
2009-05-21 21:12:54