Q:

how to loop this array to get each keys and its values

$email_recipient = array(

    "All user accounts"=> 1,
    "Not enrolled users" => 2,
    "All enrolled users" =>3,
    "Users in progress" =>4,
    "Completed users"=>5,
    "Completed and passed"=>6,
    "Completed and failed" => 7,
    "Not enrolled + in progress" => 8
);

$notification_type = array(
    "Scheduled Message" => array(1 => $email_recipient),
    "Countdown Reminder" => array(2 => array("Not enrolled users" => $email_recipient["Not enrolled users"]),array("Users in progress" => $email_recipient["Users in progress"]),array("Not enrolled + in progress" => $email_recipient["Not enrolled + in progress"])),
    "New Joiner Alert" => array(3 => array("All new joiners" => 9)),
);

how can i get values of Scheduled Message as 1 , Countdown Reminder as 2 ,New Joiner Alert as 3

A:

I don't think StackOverflow is a place where people find solutions for you. Post a try, give an hypothesis on how you could solve this. And the communityt can help you. Posting the question waiting for the answer is not the right way to stay here.
Anyway, you can get the value (if i understand you question):
$new_array = [];
foreach ($notification_type as $key => $value) {
    $new_array[$key] = array_keys($value)[0];
}

Now your array $new_array has 3 items:
$new_array = [
    "Scheduled Message" => 1,
    "Countdown Reminder" => 2,
    "New Joiner Alert" = 3
];

