PHP: how to get all variable name in php post method

I would like to get and display all the variable names that are submitted method="post"on the form. I do not know the variables that are passed from the post method to HTML. Is there a way to list all the variables sent by the post method? .. Thanks in advance.

Example: http://www.dhamu.in/oncreate2.php?workload=10&request_type=project&name=web%20design&description=we%20have%20done%20it&budget=1&bidperiod=11&project_guidelines=checked&job_113=1&xxxx=10 I have no name xxxx "

+5
source share
3 answers
foreach ($_POST as $key => $value){
  echo "{$key} = {$value}\r\n";
}

BTW, $_GET ( , foreach ($_GET as $key => $value){.) $_REQUEST , .

+16

Try:

print_r(array_keys($_POST))

... .

:

print_r($_POST)

... POST.

+2

To display all POST variables, try the following:

var_dump($_POST);

The variables that are included in the URL are actually GET variables:

var_dump($_GET);
0
source

All Articles