This snippet from theUsual, www.artfulsoftware.com/theusualReadMe.html, a radiodashboard for getting user's preferred text format, might get you started ...
$textformat = mysqli_real_escape_string( $conn, $_GET['textformat'] );
$conn = mysqli_connect(...);
$avals = array( '0', '1', '2', '3', '4', '5' );
$aprompts = array( 'as is', 'preformat', 'htmlentities', 'nl2br', 'html_entity_decode', 'nl2br & html_entity_decode' );
echo "<FORM name='settings' method='post' action='$target'>\n",
" <TABLE border='1' bgcolor='#e8e8e8'>\n",
" <tr>\n",
" <td colspan='2' NOWRAP> <em><strong>Settings</strong></em></td>\n",
" </tr>\n";
echo " <tr>\n", " <td> Text column formatting</td>\n";
radiodashboard( "cbtextformat", $avals, $aprompts, $textformat );
echo " </tr>\n";
...
function radiodashboard( $group, $aval, $aprompt, $sel ) {
echo " <td NOWRAP><table border='0'>\n";
echo " <tr>\n";
for( $i=0; $i < count($aval); $i++ ) {
$val = $aval[$i];
echo " <td align='center' NOWRAP><INPUT type='radio' name='$group' value='$val'",
(( $val == $sel ) ? " checked='true'" : "" ), "></td>\n";
}
echo " </tr>\n";
echo " <tr>\n";
for( $i=0; $i < count($aprompt); $i++ ) {
echo " <td> ", $aprompt[$i], " </td>\n";
}
echo " </tr>\n";
echo " </table></td>\n";
}