#_POST key/value question. [SOLVED]
Posted: Sun Jan 02, 2011 11:02 pm
Is there a way to access $_POST values without knowing the key?
For Example:
I managed to find something that kind of works but if the post value itself is an array, it just saves it as a string, "Array", and not the values inside that array. I need to be able to preserve the value if it's an array as well.
For Example:
Code: Select all
for ($i = 0; $i < count($_POST); $i++) {
echo $_POST[$i].'<br>';
}
Code: Select all
if ($_POST) {
$postKeys = array();
$postVals = array();
foreach ($_POST as $k => $v) {
$postKeys[] = "$k";
$postVals[] = "$v";
}
}