How can I send a complete array of requests to mail () with key and value

I have a large form that I want to mail using php, although I can submit it with a ['name'] request, I need to write it more than 50 times in the post variable, what do I want to do, how can I add keys and values ​​into a post variable with some filtering I want to omit the send request variable

0


a source to share


3 answers


I would make a copy of the variable, remove the element submit

, and then get the array declaration code with var_export

:



$array = $_REQUEST;
unset($array['submit']);
$text = var_export($array, true);

      

+1


a source


http://php.net/filter_var_array might be what you are looking for.



0


a source


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.

0


a source







All Articles