title: How to extract values from an associative array and use each value to display in different places
body: <p>Basically I have this code right now:</p>
  
  <pre><code>&lt;?php foreach($rows as $most_viewed) { ?&gt;
    print_r($most_viewed);
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>the print_r function displays something like this:</p>
  
  <pre><code>Array
  (
      [id] =&gt; 13
      [name] =&gt; item 1 
      [description_al] =&gt; bla bla
      [price] =&gt; 18.54
      [date] =&gt; 2015-07-19 23:13:48
      [category] =&gt; 1
      [brand] =&gt; 
      [image] =&gt; image-5e053b8f95f8819c37721826631c5c26136f20bfa07fd240aa9d4b3d6f939519-v.jpg
  )
  Array
  (
      [id] =&gt; 19
      [name] =&gt; item 2
      [description_al] =&gt; bla bla bla
      [price] =&gt; 13.00
      [date] =&gt; 2010-07-20 10:45:16
      [category] =&gt; 3
      [brand] =&gt; 
      [image] =&gt; img-20160217-155609.jpg 
  )
  </code></pre>
  
  <p>I want to be able to store from the first array into variables like the name of the product in one variable and the image of the product in another variable so that I can echo them out when ever I need them. I apologize if I have not made myself very clear but I dont know another way to explain my issue, thank you in advanced for your help. </p>