从$ _POST表单数据中删除提交按钮值PHP [英] Remove submit button value from $_POST form data PHP
本文介绍了从$ _POST表单数据中删除提交按钮值PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此循环来打印所有$ _POST表格数据:
I'm using this cycle to print all form $_POST data:
foreach($_POST as $name => $value) {
print "$name : $value<br>";
}
结果的最后是提交按钮值(提交:编辑),这对我造成了错误,因为在这个前足周期中,我正在将数据添加到excel文档$name is cell, $value is cell value
中,因此如何从列表中删除按钮值?
And at the end of result is submit button value (submit : Edit) and this cause error for me, because with this foreac cycle I'm adding data to excel document $name is cell, $value is cell value
so how to remove button value from the list?
推荐答案
只需使用continue;
foreach($_POST as $name => $value) {
if($name == "submit") continue;
print "$name : $value<br>";
}
这篇关于从$ _POST表单数据中删除提交按钮值PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文