Is there anyway to return the name of a $_POST variable... for example
The post array that comes back to me after i submit a form is as follows.
Array
(
[lodginpartyname] => sdfdsf
[lodginpartyregagentnumber] => sdfsdfsdf
)
Is there a way to return the "lodginpartyname" or "lodginpartyregagentnumber" etc
so that I can write something like:
function blah() {
$count = count($_POST);
$start = 0;
while ($start < $count) {
$varname = process to get variable name();
$varvalue = $_POST[$varname];
mysql_query("insert into tbl (varname,varvalue) values ('$varname','$varvalue)");
$start++;
}
}
Any ideas ??
Thanks in advance... i'm sure its something really simple, normally i wouldnt need to do this but half of the variable names are dynamically generated on the fly so this sort of logic seems the easiest way