title: PHP: How to get the min and max of a Multidimensional Array?
body: <p>I have the following multidimensional array.</p>
  
  <pre><code>$dog_treats=array(
      array(
          'Rupert' = array(
          'Breed' =&gt; 'German Shepherd',
          'treats' = array(
              0 =&gt; 3,
              1 =&gt; 2,
              2 =&gt; 6
          ),
       ),
          'Zeus' = array(
          'Breed' =&gt; 'Golden Retreiver',
          'treats' = array(
               0 =&gt; 5,
               1 =&gt; 4,
               2 =&gt; 1,
               3 =&gt; 2
          ),
       ),
     ),
  );
  </code></pre>
  
  <p>The syntax is a bit off but that's how it looks like. The code that creates it is:</p>
  
  <pre><code>$dog_treats['Rupert']['Breed'] = 'German Shepherd';
  $dog_treats['Rupert']['treats'][0] = 3;
  $dog_treats['Rupert']['treats'][1] = 2;
  $dog_treats['Rupert']['treats'][2] = 6;
  
  $dog_treats['Zeus']['Breed'] = 'Golden Retreiver';
  $dog_treats['Zeus']['treats'][0] = 5;
  $dog_treats['Zeus']['treats'][1] = 4;
  $dog_treats['Zeus']['treats'][2] = 1;
  $dog_treats['Zeus']['treats'][3] = 2;
  </code></pre>
  
  <p>For each dog I want to get the maximum and minimum number of treats they ate that day. How do I do this? Thanks</p>
  
  <p>Rupert max = 6 min = 2</p>
  
  <p>Zeus max = 5 min = 1</p>