function makeRadioButtons($name,$current,$values=array(1,0),$prompt=array("Yes","No")) {
// $name button set name
// $current current ("checked") value
// $value (optional) array of possible values, default 1 and 0
// $prompt (optional) array of possible prompts, default yes and no
$c = count($prompt);
for($i=0; $i<$c; $i++) {
$s .= ' $s .= ($values[$i]==$current) ? ' checked="checked" />':' />';
$s .= $prompt[$i]."
\n";
}
return $s;
} // end function MakeRadioButtons
// Example
$defaultButtons = makeRadioButtons('yesNo',$yesNo);
$languageValues = array('', // initial empty value
'fr_en',
'de_en',
'it_en',
'ko_en',
'pt_en',
'ru_en',
'es_en'
);
$languagePrompts = array('None',
'French to English',
'German to English',
'Italian to English',
'Korean to English',
'Portuguese to English',
'Russian to English',
'Spanish to English'
);
$languageButtons = makeRadioButtons('language',$language,$languageValues,$languagePrompts);
$msg = ($update)? 'You chose: '.$language.'
':'Choose a language
';
$radioForm=<<$msg