I have a function that takes an "Options" argument array for setting flags for querying a database. It looks like this
function c_SQL($SQL='', $FIELDS=array(), $OPTIONS=array('SINGLEROW'=>false,'foo'=>false,'bar'=>false)) {
}
I am trying to maintain the default array keys if I do not set them in my function call:
$test = c_SQL($query,$fields,array('SINGLEROW'=>true));
This is generating an error inside the c_SQL function when we do checks against the array keys not specified (foo and bar).
Is there a way to maintain 'foo' and 'bar' if not specified and only change the keys only if passed into the function?
issetfunction? If the result is false, you could always manually set the variable there.