How do I iterate through images using file_create_url()? I am trying to add Lightbox feature to images. This is the code I used in the node template.

&lt;p&gt;
&lt;a class="lightbox" href="&lt;?php echo file_create_url($node-&gt;field_images['und'][0]['uri']); ?&gt;" data-plugin-options='{"type":"image"}'&gt;
 &lt;?php print render($content['field_images']); ?&gt;
&lt;/a&gt;
&lt;/p&gt;


This works fine if I have the "field_image" limited to 1 value, but in my case the field_image can have several values (the user can upload several images).

For the first image $node-&gt;field_images['und'][0]['uri']) is correct; for the second image the path would be $node-&gt;field_images['und'][1]['uri']).

So how should I iterate through multiple images?

UPDATE(per @Clive feedback):
Here is my updated code: 

&lt;?php if ( ($items = field_get_items('node', $node, 'field_images')) ) {
  foreach ($items as $item) {
   $uri = $item['uri']; ?&gt;
 &lt;p&gt;
&lt;a class="lightbox" href="&lt;?php print $uri ?&gt;" data-plugin-options='{"type":"image"}'&gt;
&lt;?php print render($content['field_images']); ?&gt;
&lt;/a&gt;
&lt;/p&gt;
&lt;?php 
}
}
?&gt; 


I have 2 issues with it: The URL is not correct per my comment below. Second on every iteration it prints all images. For example if I have 2 images: it prints {img1/url1, img2/url1} and then on the next iteration it prints {img1/url2, img2/url2} instead of img1/url1 on the first iteration and then on the second iteration img2/url2.

How would I modify the 'print render($content[]);' to print partial content?

How  would I modify the $uri to print the full URL path?

UPDATE2(per @Rupesh feedback):
Here is my updated code: 

&lt;?php if ( ($items = field_get_items('node', $node, 'field_images')) ) {
  foreach ($items as $item) {
   $uri = $item['uri']; ?&gt;
 &lt;p&gt;
&lt;a class="lightbox" href="&lt;?php print file_create_url($uri); ?&gt;" data-plugin-options='{"type":"image"}'&gt;
&lt;?php print render($content['field_images']); ?&gt;
&lt;/a&gt;
&lt;/p&gt;
&lt;?php 
}
}
?&gt; 


Now the only issue I have is that on every iteration it prints all images. For example if I have 2 images: it prints {img1/url1, img2/url1} and then on the next iteration it prints {img1/url2, img2/url2} instead of img1/url1 on the first iteration and then on the second iteration img2/url2.

Now I need I modify the 'print render($content[]);' to print a partial content on every iteration. For example on first iteration it will be print render($content[][0]); and on second iteration it will be print render($content[][1]); etc.

Something like that (it does not work, with a blank page )

&lt;?php for ($i = 0; $i &lt; count($content['field_images']); $i++):  
 print render($content['field_images'][$i]); ?&gt;
 endfor; 
?&gt;


The count is wrong, it outputs 17 instead of just 2 images.
What would I change in in the code above to get it to work?

Thanks.
You're probably looking for a for loop, but Drupal has a specific function for this, field_get_items():

if ( ($items = field_get_items('node', $node, 'field_images')) ) {
  foreach ($items as $item) {
    $uri = $item['uri'];
  }
}