Many Thanks!

END; // One line per question, separated by ':'. Generate each question // as a line in a table. $qno = 1; // Question numbers. while(! feof($surdef)) { // Get the line and split it into parts. $line = fgets($surdef, 1024); $parts = explode(':', $line); // Generate the question. $ques = htmlspecialchars(array_shift($parts)); echo ""; // Generate the response alternatives. $rno = 1; echo "\n"; ++$qno; } fclose($surdef); // Close the HTML stuff, and generate submit and clear buttons. echo <<
     END ?>
$ques"; foreach($parts as $resp) { $resp = htmlspecialchars($resp); $resp = preg_replace('/ /', ' ', $resp); if($rno > 1) echo "    \n"; echo "$resp"; ++$rno; } echo "