I've got a form that being used to update a database. I'm having to do a lot of if "if (isset($varname)) $Array[] = $varname;" type of statements.
I tried adding the folllowing function
but when called I got a lot of
type warning. Is there any way to do macros? Or am I doomed to have to check every input?
I tried adding the folllowing function
Code:
function AddToArrayIfSet($tgtArray, $tgtVar)
{
if( isset($tgtVar))
{
$tgtArray[] = $tgtVar;
}
}
but when called I got a lot of
Code:
Notice: Undefined variable: AoA_Service in c:\inetpub\[URL unfurl="true"]wwwroot\Questionaire2.php[/URL] on line 74
type warning. Is there any way to do macros? Or am I doomed to have to check every input?