<?php

$arr = [
    "name" => [
        1 => [
            1 => "Jake"  // name of the participant being registered in the registration_type_id "1"
        ],
        4 => [
            1 => "John"  // name of the participant being registered in the registration_type_id "4"
        ],
    ],
    "surname" => [
        1 => [
            1 => "K"      // surname of the participant being registered in the registration_type_id "1"
        ],
        4 => [
            1 => "W"   // surname of the participant being registered in the registration_type_id "4"
        ],
    ],
    "answer" => [
        1 => [
            1 => [   // this array stores the answers for the participant being registered in the registration_type_id "1"
                1 => "answer1", // for question_id "1" the user that is doing the registration  answered  "answer1"
                2 => "answer2", // for question_id "2" the user that is doing the registration  answered  "answer2"
            ],
        ],
    ],
];



foreach($arr['answer'] as $key => $value)
{
    foreach($value[1] as $id => $response)
    echo "ID: $id\nResponse: $response\n";
}