If I want to save a few $_POST variables so I can validate them or wtvr, I'd generally write something like:
$name = isset($_POST['name'])? $_POST['name'] : NULL;
But I want to do the exact same thing over and over again, a number of times.
Is it bad practice to use @ in this case? $name = @$_POST['name'];
Or is there a better way to do this - like writing a function:
function getPostValue(field){
return isset($_POST[field])? $_POST[field] : NULL;
}
and then $name= getPostValue('name');
?
Thanks in advance!