Codice PHP:
function showAnswers($answers,$questions) { 
    for(
$x 0$xcount($answers); $x++) {
        if (
$x == 0) { 
             
$output "<div class=\"qanda clear\">\n";
        } else { 
            
$output "<div class=\"qanda\">";
          }
     
$output .= '<h4>Domanda' . ($x+1) . ': ' $questions[$x] . '</h4>'
    
$output .= "[list=1]\n";
     for (
$y 0;$ycount($answers[$x]); $y++) {
         if ((
$answers[$x][$y] === $answers[$x][0]) && (in_array($answers[$x][$y],$_SESSION['correct']))) {
             
$output .= "<li class=\"correctuser\">{$answers[$x][$y]} (Corretta!)\n";
         } else if (
$answers[$x][$y] === $answers[$x][0]) {
             
$output .= "<li class=\"correct\">{$answers[$x][$y]}\n";
         } else if (
in_array($answers[$x][$y],$_SESSION['wrong'])) {
             
$output .= "<li class=\"wrong\">{$answers[$x][$y]} (Erratta!)\n";
         } else { 
             
$output .= "[*]{$answers[$x][$y]}\n";
        }
    }
    
$output .= "[/list]</div>\n";
    return 
$output;
    }

$to "xxxx@email.com";
$subject "Risultato quiz di $_SESSION[user]";
$message "Nome: $_SESSION[user],
 "
;
$message .= "Cognome: $_SESSION[codverifica] 
"
;
$message .= "Risultati:  
"
.showAnswers();
$headers "From: $_SESSION[email]""\r\n";
$headers .= 'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
mail($to,$subject,$message,$headers); 
Fammi sapere