title: How to reverse foreach $key value PHP?
body: <p>My brain is off , I am using foreach index to assign z-index to elements but I need it to go in reverse order. The last one should be 0 the first one should have highest z-index;</p>
  
  <pre><code>foreach ($array as $key =&gt; $layer){
  
  
          // css z-index: $key reversed 
  }
  </code></pre>
  
  <p>any help is appreciated</p>
  
  <p><strong>EDIT:</strong>
  well , everyone is going nuts because I asked this question but I did not look for  array_reverse thus I posted a question</p>
  
  <p>I asked how to reverse the <strong>$key</strong> and only one who understood was  Sergey Krivov</p>