Print $_POST variable name along with value

前端 未结 4 658
既然无缘
既然无缘 2020-11-29 05:51

I have a POST in PHP for which I won\'t always know the names of the variable fields I will be processing.

I have a function that will loop through the values (howev

4条回答
  •  遥遥无期
    2020-11-29 06:37

    It's much better to use:

    if (${'_'.$_SERVER['REQUEST_METHOD']}) {
        $kv = array();
        foreach (${'_'.$_SERVER['REQUEST_METHOD']} as $key => $value) {
            $kv[] = "$key=$value";
        }
    }
    

提交回复
热议问题