title: Add padding to hex string for remaining bytes
body: <p>I never ever worked with Hex-strings in PHP (or whatever language). Now I'm wondering how I could add padding to a hex string with 00 (in hex) up until it reaches 8 bytes.</p>
  
  <pre><code>$hex = bin2hex("MAIN");
  </code></pre>
  
  <p>How can I add <code>00</code> for the remaining bytes so that <code>$hex</code> holds 8 bytes?</p>