title: Remove blank lines from a text file
body: <p>I have a text file that has some blank lines in it. Meaning lines that have nothing on them and are just taking up space.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>The
  
  quick
  brown
  
  fox jumped over
  the
  
  lazy dog
  </code></pre>
  
  <p>and I need it to look like this:</p>
  
  <pre><code>The
  quick
  brown
  fox jumped over
  the
  lazy dog
  </code></pre>
  
  <p>How can I remove those blank lines and take only the lines with the content and write them to a new file?</p>
  
  <p>Here is what I know how to do:</p>
  
  <pre><code>$file = fopen('newFile.txt', 'w');
  $lines = fopen('tagged.txt');
  foreach($lines as $line){
      /* check contents of $line. If it is nothing or just a \n then ignore it.
      else, then write it using fwrite($file, $line."\n");*/
  }
  </code></pre>