All pastes #901488 Raw Edit

phppost

public php v1 · immutable
·published 2008-02-12 18:28 UTC
rendered paste body
 # replace choices ----------------------------------------      if (preg_match("/(.*)\(c\s*(.*\S)\s*c\)/", $line, $matches)) {        $field_count++ ;        $choice = '<div id="answer_'.$field_count.'_box" name="answer_'.$field_count.'_box">' ;        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 .= "&nbsp;".$matches[1]                . '<input id="answer_'.$field_count.'_radio" '                . 'name="answer_'.$field_count.'_radio" '            . 'type="radio" style="border:none" value="'.$opt.'" '              . 'onFocus="return rbutFocused('.$field_count.')" '              . 'onClick="document.form1.answer_'.$field_count.'.value = this.value ; return rbutChanged('.$field_count.')" '            . '>' . $opt . "</input><br>\n" ;        }        $choice .= '<input type="hidden" '                 . 'id= "answer_'.$field_count.'"'                 . 'name= "answer_'.$field_count.'"'                 . 'value=""></input></div>' ;                     $line = preg_replace("/(.*)\(c\s*(.*\S)\s*c\)/"                 , $choice                     , $line) ;      }