title: Merge Multiple text files into one text file (and back to original files) lua and php
body: <p>Basically i have a lua client, and a php server. Lets say i have a directory on the server with multiple text files, for example:</p>
  
  <ul>
  <li>Directory on server
  <ul>
  <li>file1</li>
  <li>file2</li>
  <li>file3</li>
  </ul></li>
  </ul>
  
  <p>I would like to take all of the files in a directory and consolidate them into one, however i want it to be able to take the file and put the files back with the names. Meaning in the condensed file there would have to be a header for each segment (text from a file) For example</p>
  
  <p>Condensed Text File:</p>
  
  <pre><code>header for file1 to identify it for later use
  file1's contents here
  header for file2 to identify it for later use
  file2's contents here
  header for file3 to identify it for later use
  file3's contents here
  </code></pre>
  
  <p>this way it can be put back into place with the contents and names.</p>
  
  <p>PHP: I need php to condense a folders contents into one text file (all folder items are text files) so i can send it to the lua client</p>
  
  <p>LUA: I need lua to be able to take that data from the php server and uncondense the files into a specified folder</p>
  
  <p>I Do not want to use actual compression algorithms i just want to make all the text files into one and then put them back. Thanks</p>