title: Use json_decode on a multidimensional array
body: <p>im trying to decode a 2-dimensional array in php with json_decode.</p>
  
  <p>I create my array like this:</p>
  
  <pre><code>    $query3 = 'SELECT * FROM `files` WHERE `company`="'.$_POST['company'].'"';
      $result3 = mysql_query($query3);
      $return_type = "files";
      $data_files;
      while($row3 = mysql_fetch_object($result3))
      {
          $data_files[] .= json_encode(array("cat" =&gt; $row3-&gt;cat, "name" =&gt; $row3-&gt;name)); 
      }
  </code></pre>
  
  <p>at the bottom of my code i use this:</p>
  
  <pre><code>$return = json_encode($data_files);
  </code></pre>
  
  <p>my result looks like this:</p>
  
  <pre><code>["{\"cat\":\"3\",\"name\":\"Flyer Vorwerk C-40 11\\\/2013\"}","{\"cat\":\"4\",\"name\":\"Katalog Sommer 2013\"}","{\"cat\":\"5\",\"name\":\"Beutel wechseln\"}","{\"cat\":\"5\",\"name\":\"Teppich sauber kriegen\"}","{\"cat\":\"3\",\"name\":\"Flyer Vorwerk C-70 11\\\/2013\"}"]
  </code></pre>
  
  <p>sadly there are too many qutoes, but when i remove the first <code>json_encode();</code> in the mysql section the result looks like this </p>
  
  <pre><code>["Array","Array","Array","Array","Array"]
  </code></pre>
  
  <p>i could remove the qutoes with preg_replace(), but i want to know if there is a better solution.</p>
  
  <p>i would really appreciate your help.</p>
  
  <p>btw, sry for my crappy english!</p>