I guess it is this what you want to do:
// create an array with key = field-name in form
$val = array(
'name' => null,
'lastname' => null,
'date_of_birth' => null,
'favorite_color' => null);
if (isset($_POST['submit'])) { // form has been sent
// retrieve values from $_POST and store it in $val
foreach ($val as $key => $value)
$val[$key] = $_POST[$key];
// show the result
echo "<pre>";
var_dump($val);
echo "</pre>";
} // if isset
see live demo: http://codepad.viper-7.com/j03DtO