PHP在多维数组中获取数组的名称

I have a simple multidimensional array with two other arrays in it.

<?php
            $data = array(
              'first_array' => array(
                'name' => 'Test1',
                'description' => '...',
              ),
              'second_array' => array(
                'title' => 'Test2',
                'description' => '...',
              )
            );
        ?>

And I have a simple foreach array like this:

 function show($data, $id){

                 foreach ($data as $course) {

                 }

            }

How can I display (and get) the name of the array in every iteration (I mean if it is 'first_array' or 'second_array', not the name fields in the arrays).

Use key=>val syntax

foreach ($data as $key=>$course) {
    echo $key;
}

use this syntax for foreach :

foreach ($data as $name => $course) {
    //do sth
}