title: Trouble with zlib compressed File
body: <p>I have inherited a zlib compressed file and long story short, I need to UN-zlib-compress this puppy back to its original content.</p>
  
  <p>I have been racking my brain trying to figure out what in the world is happening, but I am hitting a wall and I am hoping you good people will help me out to figure out what's going on.</p>
  
  <p>I have done alot of things so far, I won't bore you with every single thing, but this is what I landed on last, and all I get garbled output, don't know what in the heck is wrong, especially that the last step of decode complains about the data saying:</p>
  
  <blockquote>
    <p>Warning: gzuncompress(): data error in
    C:\xampp\htdocs\test-box\index.php on line 6</p>
    
    <p>Warning: zlib_decode():
    data error in C:\xampp\htdocs\test-box\index.php on line 8</p>
  </blockquote>
  
  <p>and this is the code - nothing fancy, I am trying to get it to work before going too crazy with it yet and so the simplicity should allow us to better analyze it.</p>
  
  <pre><code>&lt;?php
      $filename = 'c5ytvbg4y.x';             // this is the zlib compressed file
      $file = filesize($filename);           // using this for the length
      $zd = gzopen($filename, "r");          // create valid pointer
      $contents = gzread($zd, $file);        // binary safe read the content
      $decoded = gzuncompress($contents);    // using gzdecode produces the same issue
      gzclose($zd);                          // close the pointer
      zlib_decode($decoded);                 // decode it but I get nothing but garble
  ?&gt;
  </code></pre>
  
  <p>Any assistance would be appreciated. Ideally I want to be able to open it uncompress it back to normal and save it to a new file. But at the moment I would be happy just to find out why in the heck I get nothing but garbled text back. Also keep in mind that I know the <code>$file</code> above is not ideal, I will put a <code>while !feof($zd)</code> or something to that effect later, I wanted to keep it simple for now while trying get the larger issue figured out.</p>
  
  <p>Any thoughts, recommendations, suggestions, code assistance, or whatnot would be greatly appreciated, TIA.</p>
  
  <h2>Additions</h2>
  
  <p>@Mark's Request:</p>
  
  <pre><code>0A 12 0F 04 04 D8 44 DA BF 63 C4 93 93 3B 49 51 17 A2 6F E3 0C 12 4D E4 24 F6 C8 BA D0 60 76 81
  </code></pre>