title: PHP convert KB MB GB TB etc to Bytes
body: <p><br />
  I'm asking how to convert KB MB GB TB &amp; co. into bytes.<br />
  For example:</p>
  
  <pre><code>byteconvert("10KB") // =&gt; 10240
  byteconvert("10.5KB") // =&gt; 10752
  byteconvert("1GB") // =&gt; 1073741824
  byteconvert("1TB") // =&gt; 1099511627776
  </code></pre>
  
  <p>and so on...</p>
  
  <p>EDIT: wow. I've asked this question over 4 years ago. Thise kind of things really show you how much you've improved over time!</p>