Print $_POST variable name along with value

前端 未结 4 664
既然无缘
既然无缘 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:30

    If you want to detect array fields use a code like this:

    foreach ($_POST as $key => $entry)
    {
        if (is_array($entry)){
            print $key . ": " . implode(',',$entry) . "
    "; } else { print $key . ": " . $entry . "
    "; } }

提交回复
热议问题