title: how to retrieve the value from an array - Cakephp
body: <p>I am having a table named reports having <code>(id,form_id,title)</code></p>
  
  <p>and another table form<code>(id,name)</code></p>
  
  <p>in my reports.ctp
  i am listing all my reports title by fetching it from the table using</p>
  
  <pre><code>function reports()
  {
      $allreports= $this-&gt;Report&gt;find('all',
                                      array('conditions'=&gt;array('Report.user_id'=&gt;$userId),
                                            'group' =&gt; array('Report.report_id')));
  
      foreach($allreports as &amp; $report):
          $report['Report']['formname'] = $this-&gt;Form-&gt;find('all',
                  array(
                      'fields'=&gt;array('Form.name'),
                      'conditions'=&gt;array('Form.id'=&gt;$report['Report']['form_id'])));
      endforeach;
  
      $this-&gt;set('allreports', $allreports);
  }
  </code></pre>
  
  <p>i have used foreach to find the corresponding Form name from the Forms table..</p>
  
  <p>in my <code>reports.ctp</code></p>
  
  <p>i want both the reports title and Form name correponding for it one by one like</p>
  
  <pre><code>Report1 - Form name - Form1
  
  Report2 - Form name - Form2
  
  Report3 - Form name - Form1
  </code></pre>
  
  <p>i have tried the above using</p>
  
  
  
  <pre><code>          &lt;div&gt; &lt;a href="#"&gt;
                              Reportname:    &lt;?php echo $report['Report']['title'];?&gt;
         &lt;/a&gt;
         &lt;a href="#"&gt;   Form name &lt;?php echo $report['Report']['formname'];?&gt;&lt;/a&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>But i am getting as Array for  like</p>
  
  <pre><code>Report1 - Form name - Array
  
  Report2 - Form name - Array
  
  Report3 - Form name - Array
  </code></pre>
  
  <p>how to do so?? please suggest me..</p>