title: Laravel Lumen | get single values from array
body: <p>I have a problem for like 4 hours. </p>
  
  <pre><code> $getrank = DB::table('users')-&gt;select('codes')-&gt;orderBy('codes', 'desc')-&gt;get();
  </code></pre>
  
  <p>with <code>var_dump($getrank);</code> I see whats in the array.</p>
  
  <p>So I got this:</p>
  
  <pre><code>array(6) {
      [0] =&gt; object(stdClass)#62 (1) { 
          ["codes"]=&gt; int(584)
      }
      [1] =&gt; object(stdClass)#64 (1) { 
          ["codes"]=&gt; int(117) 
      } [2] =&gt; object(stdClass)#65 (1) { 
          ["codes"]=&gt; int(88) 
      } [3] =&gt; object(stdClass)#66 (1) {
          ["codes"]=&gt; int(66) 
      } [4] =&gt; object(stdClass)#67 (1) { 
          ["codes"]=&gt; int(53)
      } [5] =&gt; object(stdClass)#68 (1) { 
          ["codes"]=&gt; int(37)
      } 
  }
  </code></pre>
  
  <p>But I want them seperated.
  I tried a lot!</p>
  
  <p>In the end I thought this could be my answer:</p>
  
  <pre><code>echo $getrank[0]['codes'];
  echo $getrank[1]['codes'];
  echo $getrank[2]['codes'];
  echo $getrank[3]['codes'];
  echo $getrank[4]['codes'];
  echo $getrank[5]['codes'];
  </code></pre>
  
  <p>But no.</p>
  
  <p>I want a ranking, and I just need the first 5 ([0]-[4]). What else can I do?
  In the end I want every value as a string!</p>