title: tab-delimited string to XML with PHP
body: <p>I'm trying to write the tab-delimited content of a variable to XML like this:</p>
  
  <pre><code>$tsvData = str_getcsv($input, "\t");
  foreach($tsvData as $line =&gt; $row) {
      if($line &gt; 0) {
          $xmlWriter-&gt;writeElement('NAME', $row[0]);
          $xmlWriter-&gt;writeElement('CAKE', $row[1]);
          $xmlWriter-&gt;writeElement('BODYPART', $row[2]);
      }
  }
  </code></pre>
  
  <p>But it's only writing one character per XML tag instead of everything between each tab. When I use SplFileObject, geting the same tsv data but from a file, it works.  What am I doing wrong with the str_getcsv function?</p>
  
  <p>Thanks</p>