title: Convert string to binary then back again using PHP
body: <p>Is there a way to convert a string to binary then back again in the standard PHP library?</p>
  
  <p>To clarify what I'm trying to do is store a password on a database. I'm going to convert it first using a hash function then eventually store it as binary.</p>
  
  <hr>
  
  <p>I've found the best way is to use this function. Seems to hash and output in binary at the same time.</p>
  
  <p><a href="http://php.net/manual/en/function.hash-hmac.php">http://php.net/manual/en/function.hash-hmac.php</a></p>