How do I nest two field in my node.tpl.php? I have two fields of multiple values. When I print render($content['field_photo']) and render($content['field_photo_caption']) I get: 

&lt;img&gt;
&lt;img&gt;
&lt;img&gt;
&lt;p&gt;caption&lt;/p&gt;
&lt;p&gt;caption&lt;/p&gt;
&lt;p&gt;caption&lt;/p&gt;


How do I nest the values to get:

&lt;img&gt;
&lt;p&gt;caption&lt;/p&gt;
&lt;img&gt;
&lt;p&gt;caption&lt;/p&gt;
&lt;img&gt;
&lt;p&gt;caption&lt;/p&gt;
Here is the code to solve problem

  $image = field_get_items('node', $node, 'field_text_multiple');
  $text = field_get_items('node', $node, 'field_multiple_second');
  foreach ($text as $key =&gt; $value) {
    $second_field[] = field_view_value('node', $node, 'field_multiple_second', $text[$key]);
  }
  foreach ($image as $key =&gt; $value) {
    $output = field_view_value('node', $node, 'field_text_multiple', $image[$key]);
    print render($output);
    print "&lt;br&gt;";
    print render($second_field[$key]);
    print "&lt;br&gt;";
  }