title: Max Value of multidimensional array
body: <p>I have this Array</p>
  
  <pre><code>  Array
  (
      [2014-08-14] =&gt; Array
          (
              [18:00:00] =&gt; Array
                  (
                      [6] =&gt; Array
                          (
                              [price] =&gt; 15.36
                              [avail_clean] =&gt; 5
                              [avail_noclean] =&gt; 6
                          )
  
                      [7] =&gt; Array
                          (
                              [price] =&gt; 17.35
                              [avail_clean] =&gt; 2
                              [avail_noclean] =&gt; 3
                          )
  
                  )
  
              [19:00:00] =&gt; Array
                  (
                      [6] =&gt; Array
                          (
                              [price] =&gt; 15.36
                              [avail_clean] =&gt; 5
                              [avail_noclean] =&gt; 6
                          )
  
                      [7] =&gt; Array
                          (
                              [price] =&gt; 17.35
                              [avail_clean] =&gt; 2
                              [avail_noclean] =&gt; 3
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>How can I get the following for 6 &amp; 7 seperately:
  - Sum of price
  - max of avail_clean
  - max of avail_noclean</p>
  
  <p>I got that far for the price:</p>
  
  <pre><code>foreach ($bookable as $date=&gt;$key) {
      foreach ($key as $time=&gt;$key2) {
          foreach($key2 as $room=&gt;$key3){
              foreach($key3 as $price=&gt;$key4){
                  if($price == "price"){
                      if(isset($sumRoom[$room]['total'])){
                          $sumRoom[$room]['total'] += $key4;
                      }else{
                          $sumRoom[$room]['total'] = $key4;
                      }
                  }
              }
          }
  
      }
  }
  </code></pre>
  
  <p>Gives me this</p>
  
  <pre><code>Array(
  [6] =&gt; Array
      (
          [total] =&gt; 30,72
      )
  
  [7] =&gt; Array
      (
          [total] =&gt; 34,7
      )
  </code></pre>
  
  <p>)</p>
  
  <p>But what about the max(), where should I put that?</p>