title: PHP explode a txt file
body: <p><strong>I have the following txt file:</strong></p>
  <blockquote>
  <p>++Marry++M++B++NY++</p>
  <p>++Jack++F++O++LS++</p>
  </blockquote>
  <p><strong>write to a .txt file:</strong></p>
  <blockquote>
  <p>Name:Marry</p>
  <p>Sex:M</p>
  <p>Blood type:B</p>
  <p>City:NY</p>
  <p>Name:Jack</p>
  <p>Sex:F</p>
  <p>Blood type:O</p>
  <p>City:LS</p>
  </blockquote>
  <p>My code is:</p>
  <pre><code>$fn = fopen(&quot;test.txt&quot;,&quot;r&quot;) or die(&quot;fail to open file&quot;);
   
  $content = array();
   
   while($row = fgets($fn)) {
  
      $num = explode(&quot;++&quot;, $row);
      $name = $num[0];
      $sex = $num[1];
      $blood =  $num[2];
      $city = $num[3];
   }
  
  $fp = fopen('output.txt', 'w');     
  fwrite($fp, $row);
  fclose($fp);
  </code></pre>
  <p>Should this work? Because it returns nothing.</p>
  <p>Thx.</p>