any ideas? in the second case $v is an array I could do is_array($v), but I'd have to repeat the if/else anyway
foreach(array('city', 'location') as $f) {
$ors[$f] = array();
if (!isset($_POST[$f])) continue;
$v = $_POST[$f];
if (isset($df[$f][$v])) {
array_push($ors[$f], $df[$f][$v]);
}
else {
security_error();
}
}
foreach(array('age', 'sex') as $f) {
$ors[$f] = array();
if (!isset($_POST[$f])) continue;
foreach($_POST[$f] as $v) {
if (isset($df[$f][$v])) {
array_push($ors[$f], $df[$f][$v]);
}
else {
security_error();
}
}
}
security_error()do? Also, what is$df?