echo $_POST["name"]; //returns the value a user typed into the "name" field
我也希望能够返回 key 的文本。在此示例中,我想返回文本“名称”。我可以这样做吗?
最佳答案
$_POST 只是一个普通的关联数组,因此您也可以像这样循环整个内容:
foreach($_POST as $key=>$value)
{
echo "$key=$value";
}
关于php - 如何从 $_POST 获取键值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/183914/