title: Get first eight bytes of a MD5 string
body: <p>I want to get the first eight bytes of a calculated MD5 string. In Ruby I do this:</p>
  
  <pre><code>Digest::MD5.digest("foo")[0, 8]
  </code></pre>
  
  <p>What is the best way to do this in PHP?</p>
  
  <p>EDIT: I don't want it as a String, which <code>substr()</code> returns. I thought of calling <code>md5("foo", true)</code>, where the true parameter enables returning binary. I want to cut the 16 bytes to 8 bytes.</p>