[英]how i can send complete request array in mail() with key and value
我有一个很大的形式,我想使用php发送邮件,尽管我可以使用request ['name']发送它,但是我必须在message变量中写50多次,我想怎么做才能添加密钥和值到消息变量与一些过滤,我想省略提交请求变量
I would make a copy of the variable, delete the submit
element and then get the array declaration code with var_export
: 我会做变量的拷贝,删除submit
元素,然后获得与数组声明代码var_export
:
$array = $_REQUEST;
unset($array['submit']);
$text = var_export($array, true);
http://php.net/filter_var_array可能就是您想要的。
Doesn't foreach do exactly that ? foreach难道不完全那样吗?
foreach (filter_var_array($_REQUEST, ..) as $key => $value) {
echo $key.' => '.$value."\n";
}
Of course don't forget to filter the data itself. 当然,不要忘记过滤数据本身。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.