title: implement atoi() of C in PHP
body: <p>There's a function in C, atoi(), implement this in PHP;</p>
  
  <ul>
  <li>$string = '5467'; //function should return 5467 as integer</li>
  </ul>
  
  <p>So this is what I found (<code>its implementation in C</code>)</p>
  
  <pre><code>int myatoi(const char *string) {
      int i;
      i=0;
      while(*string) {
          i = (i&lt;&lt;3) + (i&lt;&lt;1) + (*string - '0');
          string++;
      }
  </code></pre>