title: How can I read PNG Metadata from PHP?
body: <p>This is what I have so far: </p>
  
  <pre><code>&lt;?php
  
  $file = "18201010338AM16390621000846.png";
  
  $test = file_get_contents($file, FILE_BINARY);
  
  echo str_replace("\n","&lt;br&gt;",$test);
  
  ?&gt;
  </code></pre>
  
  <p>The output is sorta what I want, but I really only need lines 3-7 (inclusively).  This is what the output looks like now: <a href="http://silentnoobs.com/pbss/collector/test.php" rel="noreferrer">http://silentnoobs.com/pbss/collector/test.php</a>.  I am trying to get the data from "PunkBuster Screenshot (±) AAO Bridge Crossing" to "Resulting: w=394 X h=196 sample=2".  I think it'd be fairly straight forward to read through the file, and store each line in an array, line[0] would need to be "PunkBuster Screenshot (±) AAO Bridge Crossing", and so on.  All those lines are subject to change, so I can't just search for something finite.</p>
  
  <p>I've tried for a few days now, and it doesn't help much that I'm poor at php.</p>