title: PHP loop thru hex numbers from a form POST always gives the first number as 0. why?
body: <p>i have a form with two text fields, "from" and "to."</p>
  
  <p>when i enter values such as "100000" and "10000F" and do a for loop, it always comes out like: </p>
  
  <p>0 100001 100002 100003 100004 100005 100006 100007 100008 100009 10000a 10000b 10000c 10000d 10000e 10000f</p>
  
  <p>if i plug in the range for the loop manually, i get: </p>
  
  <p>100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 10000a 10000b 10000c 10000d 10000e 10000f</p>
  
  <p>using:</p>
  
  <pre><code>for ($i = '0x'.$_POST['from']; $i &lt;= '0x'.$_POST['to']; $i++) { print dechex($i)."\n"; }
  </code></pre>
  
  <p>versus:</p>
  
  <pre><code>for ($i = 0x100000; $i &lt;= 0x10000F; $i++) { print dechex($i)."\n"; }
  </code></pre>
  
  <p>if anyone knows what i am doing wrong here, please let me know. </p>
  
  <p>i have also tried tried adding the "0x" to the numbers via the form with the same results. </p>
  
  <p>thanks! </p>