title: Dynamic CSS ID with PHP
body: <p>A newbie here. Trying to increment CSS ID selector with PHP.
  Following the code I have</p>
  
  <pre><code>&lt;?php
  $thumbnails = get_post_meta($post-&gt;ID, "plans", false);
  if ($thumbnails[0] != '') :?&gt;
  &lt;div id="images-box"&gt;
  &lt;?php foreach($thumbnails as $thumb) {
      echo '&lt;div class="holder"&gt;
          &lt;div id="image-'. $id .'" class="image-lightbox"&gt;
              &lt;span class="close"&gt;&lt;a href="#"&gt;X&lt;/a&gt;&lt;/span&gt;
              &lt;img src="' . $thumb . '" alt="" /&gt;
              &lt;a class="expand" href="#image-1"&gt;&lt;/a&gt;
          &lt;/div&gt;';
  } ?&gt;
  &lt;/div&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>What I want is</p>
  
  <pre><code>&lt;div id="image-1" class="image-lightbox"&gt;
  &lt;div id="image-2" class="image-lightbox"&gt;
  &lt;div id="image-3" class="image-lightbox"&gt;
  </code></pre>
  
  <p>I tried with many options that were answered here (<a href="http://codepad.org/OHuTxQPI" rel="nofollow">http://codepad.org/OHuTxQPI</a>) but couldn't get it right.</p>