<?php

    echo "<h2>Answers for participants</h2>";
    for($index=0;$index < count($_POST['participant']); $index++) {
        echo "<p>{$_POST['participant'][$index]['name']} {$_POST['participant'][$index]['surname']}</p>";
        echo "<p>Registration Type: {$_POST['participant'][$index]['rtypes']}</p>";
        for($qindex=0;$qindex < count($_POST['participant'][$index]['questions']); $qindex++) {
            $id = $_POST['participant'][$index]['questions'][$qindex];
            foreach($id['question_id'] as $key => $question) {
                echo "<p>Question ID: $key answer {$question['answer']}</p>";
            }
        }
    }