How to get only one result from foreach(PHP)
<p>The code loop an array and display all views for a user. Now things changed and I just need to display one result from a foreach loop. How do I do that?</p>

<pre><code>&lt;table class="report_edits_table"&gt;
&lt;thead&gt;
  &lt;tr class="dates_row"&gt;
  &lt;?php foreach($report['edits'] as $report_edit) : ?&gt;
    &lt;td colspan="2" report_edit_id="&lt;?php echo $report_edit['id'] ?&gt;"&gt;&lt;div class="date_container"&gt;
    &lt;?php if($sf_user-&gt;hasCredential(Attribute::COACHING_EDIT_ACCESS)) : ?&gt;
      &lt;span class="ui-icon ui-icon-trash"&gt;Remove&lt;/span&gt;
    &lt;?php endif?&gt;
    &lt;?php echo "View " . link_to($report_edit['created'], sprintf('coaching/viewReportEdit?reportedit=%s', $report_edit['id']), array('title' =&gt; 'View This Contact')) ?&gt; &lt;/div&gt;&lt;/td&gt;
  &lt;?php endforeach ?&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;?php foreach($report['edits_titles'] as $index =&gt; $title) : ?&gt;
  &lt;tr class="coach_row"&gt;
    &lt;?php for ($i=max(0, count($report['edits'])-2); $i&lt;count($report['edits']); $i++) : $report_edit = $report['edits'][$i] ?&gt;
    &lt;td class="name_column"&gt;&lt;?php echo $title ?&gt;&lt;/td&gt;
    &lt;td class="value_column"&gt;&lt;?php echo $report_edit[$index] ?&gt;&lt;/td&gt;
    &lt;?php endfor ?&gt;
  &lt;/tr&gt;
  &lt;?php endforeach ?&gt;
&lt;/tbody&gt;
</code></pre>

<p></p>
