title: How to do 3*3 matrix multiplication in php?
body: <p>How can i do 3*3 or 3*1 matrix multiplication in php with following code. where should i have to change the logic ?????</p>
  
  <p>this code completely work for only 2*2 matrix multiplication</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$a = Array( Array(1,2),Array(4,5));
  $b = Array( Array(7,5), Array(3,2));
  
  $sumArray = array();
  
  $c = array();
  
  for($i=0;$i&lt;2;$i++)
  {
      for($j=0;$j&lt;2;$j++)
      {
          $c[$i][$j]=0;
          for($k=0;$k&lt;2;$k++)
          {
  
              $c[$i][$j]=$c[$i][$j]+($a[$i][$k]*$b[$k][$j]);
          }
      }
  }
  
  
  echo "&lt;pre/&gt;";
  print_r($c);
  ?&gt;
  </code></pre>