title: converting Gbs / Mbs to bytes
body: <p>I have a switch case like this</p>
  
  <pre><code>switch($filesize_in_bytes){
      case "10Mb &lt;= $filesize_in_bytes &lt;= 100Mb":
          //do some stuff and break;
  
      case "1Gb &lt;= $filesize_in_bytes &lt;= 10Gb":
          //do some stuff and break;
  }
  </code></pre>
  
  <p>As you can see <code>$filesize_in_bytes</code> is in bytes, now how can I convert those values with Mbs and Gbs into bytes? The cases <code>10Mb, 100Mb, 1Gb and so on</code> I cant hardcode them directly to bytes and the values too are different based on user status.</p>
  
  <p>The case are fetched from database:</p>
  
  <pre><code>$rule1[0] = '10Mb';
  $rule1[1] = '100Mb';
  
  $rule2[0] = '1Gb';
  $rule2[1] = '10Gb';
  </code></pre>