$value) { if ($key == "question") $question = $value; else if ($key == "course") $course = $value; else if (preg_match("#^answer#", $key) && $key != "") $answers[] = $value; } //Check we have at least a question and an answer if (empty($question)) die("Veuillez indiquer une question !"); else if (count($answers) <= 0) die("Veuillez indiquer au moins une réponse correcte !"); else { $file = new QuestionsFile('questions.xml'); $id = POST_['id']; $quest = $file->get_question($id); $quest->setCourse($couse); $quest->setQuestion($question); $quest->setAnswer($answers); // Is this enought to change the xml ? $file->save(); ?>