title: Finding last pair in associative array
body: <p>I'm looping through an associative array with a foreach. I'd like to be able to check if the key value pair being handled is the last so I can give it special treatment. Any ideas how I can do this the best way? </p>
  
  <pre><code>foreach ($kvarr as $key =&gt; $value){
     // I'd like to be able to check here if this key value pair is the last
     // so I can give it special treatment
  }
  </code></pre>