title: php text file to array of arrays
body: <p>i got a text file that contains </p>
  
  <pre><code>a b c 
  
  a c
  
  b
  </code></pre>
  
  <p>i want to read the text file and convert it to array of arrays like this</p>
  
  <pre><code>  array(
          array('a', 'b', 'c'),
          array('a', 'c'),
          array('b'));
  </code></pre>
  
  <p>i want to split each line in an array and each word in a index in the array</p>
  
  <p>i tried this code but it only split each line in a array i want each word in a array of the line</p>
  
  <pre><code>$file="140724.txt";
  $fopen = fopen($file, r);
  $fread = fread($fopen,filesize($file));
  fclose($fopen);
  $remove = "\n";
  $split = explode($remove, $fread);
  $array[] = null;
  $tab = "\t";
  foreach ($split as $string)
  {
      $row = explode($tab, $string);
      array_push($array,$row);
  }
  echo "&lt;pre&gt;";
  print_r($array);
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>i got this result</p>
  
  <pre><code>Array
  
  (
  
      [0] =&gt; 
  
      [1] =&gt; Array
          (
              [0] =&gt; a b c
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; a b
          )
  
      [3] =&gt; Array
          (
              [0] =&gt; c
          ))
  
  </code></pre>