Since through $_POST
what we get is:
An associative array of variables passed to the current script ...
$_POST
in the PHP Manual
And taking into account that the keys of that array are the values of the attribute name
, in the case that what you pass by POST is a form.
So, if you are only interested in the keys, you can use array_keys
, to obtain them, since this function:
Returns all the keys of an array or a subset of keys of a
array.
array_keys
in the PHP Manual
Then:
$arrLlaves=array_keys($_POST);
You will create an array only with each value of the attributes name
of your form. To read them, you have to do it as the arrays are read.
On the contrary, if you are also interested in the values, you can proceed as indicated by @ Sr1871 in your answer.