title: What the correct way to get size of binary data in php?
body: <p>I've read a part of file and now want to make sure the part is the right size. How can I do it in php?</p>
  
  <pre><code>$part = fread($file, 1024);
  return some_function($part) == 1024;
  </code></pre>
  
  <p>I've read the examples, but a I doubt to use strlen in cause of Null-terminated string, that might be inside the binary data in $part. In this way strlen returns size from start of part and until first null-byte is presented in data.</p>