First, my apologies - I should not have put the '=' in
<?= activeOptions($row['active']) ?>
If you want to call it from within a printf call, rewrite the function to return a string result as follows
function pActiveOptions($dbOption) {
$options = array('Tentative', 'Yes', 'No');
$result = '';
foreach ($options as $opt) {
$result .= "<option value=\"$opt\" "
if ($opt == $dbOption) $result .= " selected " ;
$result .= " > $opt </option>" ;
}
return $result;
}
Now you can call it with
printf ("<select name='Active'> %s </select> " , pActiveOptions($sActive) );