# replace choices ---------------------------------------- if (preg_match("/(.*)\(c\s*(.*\S)\s*c\)/", $line, $matches)) { $field_count++ ; $choice = '
' ; foreach (preg_split("/\s+/",preg_quote($matches[2])) as $opt) { if (substr($opt,0,1) == '&') { # right option $opt = substr($opt,1) ; $answer_table .= ", '".answer_hash($opt)."'" ; } $choice .= " ".$matches[1] . '' . $opt . "
\n" ; } $choice .= '
' ; $line = preg_replace("/(.*)\(c\s*(.*\S)\s*c\)/" , $choice , $line) ; }