this is the array i like to sort in a particular order

```
$aData = Array
  (
    [break] => Array
        (
            [Indoor room] => 42
            [Gym Class] => 19
        )
    [finish] => Array
        (
            [Indoor room] => 42
            [Gym Class] => 19
        )

    [lunch] => Array
        (
            [Indoor room] => 7
        )

    [period1] => Array
        (
            [Indoor room] => 12
            [Gym Class] => 22
        )

    [period2] => Array
        (
            [Gym Class] => 14
            [Indoor room] => 25
        )

    [period3] => Array
        (
            [Gym Class] => 21
            [Indoor room] => 11
        )

    [period4] => Array
        (
            [Gym Class] => 22
            [Indoor room] => 20
        )

    [period5] => Array
        (
            [Gym Class] => 16
            [Indoor room] => 9
        )

)

```

But i like it in this order:

```
break, period1, period2, lunch, period3, period5, period6, finish

```

for this I am trying the following php code

```
$arraySort = [
  "break",  
  "period1", 
  "period2", 
  "period3", 
  "lunch",
  "period4",
  "period5", 
  "period6", 
  "finish" 
];

   foreach($aData as $period => $catsScore){
  echo 'test '.$period.'<br/>';  
  $periodItem = [$period];
  foreach($arraySort as $cat){
      echo 'new: '.$cat.'<br/>';
      $periodItem[] = $catsScore;
  }
  $output[] = $periodItem;
    }

print_r($output);

```