For debugging purposes, I want to know if any stray POST variables are making it to specific scripts of mine.
Usually, I simply know the POST name value like:
$var = $_POST['fieldname'];
And I can do a simple <pre> listing, if I want:
echo '<pre>';
print_r($_POST,false);
echo '</pre>';
Which gives me:
Array
(
[firstname] => john
[lastname] => smith
[Submit] => Submit
)
So, for kicks, I want to alert myself if there's some unknown POST variable being passed. Which means I need to know what POST variables are to be expected:
$expected_post_names = array("firstname","lastname","Submit");
Any thoughts on how to compare the expected array to what's being passed?