title: PHP - Find max/highest value
body: <p>I have this query:</p>
  
  <pre><code>    $stmt=$dbh-&gt;prepare("select round((expire - unix_timestamp()) / 86400) as days, count(*) as cnt from xeon_users_rented WHERE user_by=:username group by days;");
      $stmt-&gt;bindParam(":username",$userdata['username']);
      $stmt-&gt;execute();
      $data=$stmt-&gt;fetchAll();
  </code></pre>
  
  <p>Which returns this array result <code>var_dump($data)</code>:</p>
  
  <pre><code>array(2) {
    [0]=&gt;
    array(4) {
      ["days"]=&gt;
      string(2) "27"
      [0]=&gt;
      string(2) "27"
      ["cnt"]=&gt;
      string(1) "2"
      [1]=&gt;
      string(1) "2"
    }
    [1]=&gt;
    array(4) {
      ["days"]=&gt;
      string(3) "116"
      [0]=&gt;
      string(3) "116"
      ["cnt"]=&gt;
      string(1) "8"
      [1]=&gt;
      string(1) "8"
    }
  }
  </code></pre>
  
  <p>I then want to get the highest value of the <code>$data</code> result:</p>
  
  <pre><code>echo max($data["days"]);    
  </code></pre>
  
  <p>Althoug that doesn't work, as nothing is getting echoed out.
  What am I doing wrong?</p>