title: get partial data from BLOB as hex
body: <p>I have a long binary written to MySQL as long BLOB.
  When I read the BLOB back from the DB by my PHP app, I would like to take the first 12 bytes only as hex.
  I successfully converted the BLOB to hex by using bin2hex(BLOB) but don't know how to ignore the data over the first 12 bytes.</p>