title: php get string from binary file
body: <p>I have JPG image with XMP meta data inside.<br>
  I'd like to read this data, but how?</p>
  
  <pre><code>$content = file_get_contents($fileName);
  var_dump($content);
  </code></pre>
  
  <p>displays real number of bytes <code>553700</code>
  but</p>
  
  <pre><code>$len = strlen($content);
  var_dump($len);
  </code></pre>
  
  <p>displays <code>373821</code></p>
  
  <p>So, I can't simple do </p>
  
  <pre><code>$xmpStart = strpos($content, '&lt;x:xmpmeta');
  </code></pre>
  
  <p>because I get wrong offset.
  So, the question is, how to find and read string from binary file in PHP?
  (I have mb_string option <code>ON</code> in php.ini)</p>
  
  <p><strong>UPD1:</strong></p>
  
  <p>I have some binary file. How can I check in PHP, this file contains several strings or not?</p>