title: strcmp equivelant for integers (intcmp) in PHP
body: <p>So we got this function in PHP </p>
  
  <pre><code>strcmp(string $1,string $2) // returns -1,0, or 1;
  </code></pre>
  
  <p>We Do not however, have an intcmp(); So i created one:</p>
  
  <pre><code>function intcmp($a,$b) {
      if((int)$a == (int)$b)return 0;
      if((int)$a  &gt; (int)$b)return 1;
      if((int)$a  &lt; (int)$b)return -1;
  }
  </code></pre>
  
  <p>This just feels dirty.  What do you all think?</p>
  
  <p>this is part of a class to sort Javascripts by an ordering value passed in.</p>
  
  <pre><code>class JS
  {
      // array('order'=&gt;0,'path'=&gt;'/js/somefile.js','attr'=&gt;array());
      public $javascripts = array(); 
      ...
      public function __toString()
      {
          uasort($this-&gt;javascripts,array($this,'sortScripts'));
          return $this-&gt;render();
      }
      private function sortScripts($a,$b)
      {
          if((int)$a['order'] == (int)$b['order']) return 0;
          if((int)$a['order'] &gt; (int)$b['order']) return 1;
          if((int)$a['order'] &lt; (int)$b['order']) return -1;
      }
      ....
  }
  </code></pre>