title: Notice: Array to string conversion in C:\xampp\htdocs\example\echo.php on line 8 Array
body: <pre><code>&lt;?php
      $products = array();    
      $products[101] = array(
          "name" =&gt; "Logo Shirt, Red",
          "price" =&gt; 18,
          "img" =&gt; "img/shirts/shirts-101.jpg"
  );
      echo $products;
  ?&gt;
  </code></pre>
  
  <p>I am trying to run this php file and it keeps giving me this error - 
   <strong>Notice: Array to string conversion in C:\xampp\htdocs\example\echo.php on line 8 Array.</strong></p>
  
  <p>All i want to do is echo out each and every element inside the array.
  I've also tried</p>
  
  <pre><code>&lt;?php
      $products = array();    
      $products[101] = array(
          "name" =&gt; "Logo Shirt, Red",
          "price" =&gt; 18,
          "img" =&gt; "img/shirts/shirts-101.jpg"
      );
      foreach($products as $product){
          echo $product;
      }
  ?&gt;
  </code></pre>
  
  <p>EDIT1: okay guys what if there are multiple similar arrays like 
      $product[101]
      $product[102]
      $product[103]
      $product[104]
      .
      .
      .
      $product[n]</p>
  
  <p>What then?</p>