title: Print multidimensional associative array column ways in html table
body: <p>I am a beginner in PHP and I have a large amount of data in a multidimensional array</p>
  
  <pre><code>$result = 
  array
      (
      array(
          array("name" =&gt; "Volvo", "price" =&gt; 2222, "model" =&gt;18),
          array("name" =&gt; "Tata", "price" =&gt; 2222, "model" =&gt;18),
          array("name" =&gt; "Asoka", "price" =&gt; 2222, "model" =&gt;18),
          ),
      array(
          array("name" =&gt; "BMW", "price" =&gt; 2222, "model" =&gt;17),
          array("name" =&gt; "Benz", "price" =&gt; 2222, "model" =&gt;17),
          array("name" =&gt; "Maroti", "price" =&gt; 2222, "model" =&gt;17),
          ),
      array(
          array("name" =&gt; "porse", "price" =&gt; 25648, "model" =&gt;16),
          array("name" =&gt; "farari", "price" =&gt; 25486, "model" =&gt;16),
          array("name" =&gt; "Volvo", "price" =&gt; 25422, "model" =&gt;16),
          ),
  
      );
  </code></pre>
  
  <p>I iterate through the array with a foreach loop, and print the model row ways,</p>
  
  <pre><code>foreach($result as $k =&gt; $datas){
           echo $datas[$k]['model'].'--&gt;';
              foreach($datas as $key =&gt; $data){
               //print_r($data);
                   echo $data['price'] ;
                   echo $data['name'].'-*-';
                }
                echo '&lt;br&gt;';
           }
  </code></pre>
  
  <p>and when I run this code, I receive the following output:</p>
  
  <pre><code>18--&gt;2222Volvo-*-2222Tata-*-2222Asoka-*-
  17--&gt;2222BMW-*-2222Benz-*-2222Maroti-*-
  16--&gt;25648porse-*-25486farari-*-25422Volvo-*-
  </code></pre>
  
  <p>However, I am trying to print column ways this array in html table, in a similar fashion to below:</p>
  
  <pre><code>   18   --&gt;     17   --&gt;    16--&gt;
  2222-Volvo  2222-BMW      25648-porse
  2222-Tata   2222-Benz     25486-farari
  2222Asoka   2222-Maroti   25422-Volvo
  </code></pre>