title: PHP - Check for positive / negative numeric strings
body: <p>I'd like to know what is the best way to check whether a numeric string is positive or negative. <p> I am using this <a href="https://stackoverflow.com/questions/2559923/shortest-way-to-check-if-a-variable-contains-positive-integer-using-php">answer on S.O</a> but I am not able to determine whether a number with decimals is + or - </p></p>
  
  <p> For example : </p>
  
  <p><p></p>
  
  <pre><code>function check_numb($Degree){
    if ( (int)$Degree == $Degree &amp;&amp; (int)$Degree &gt; 0 ) {
      return 'Positive';
  } else {
      return 'Negative';
    }
  }
  
  print check_numb("+2"); // returns Positive
  print check_numb("+2.0"); // returns Positive
  print check_numb("+2.1"); // returns Negative ??
  print check_numb("+0.1"); // returns Negative ??
  print check_numb("-0.1"); // returns Negative
  </code></pre>
  
  <p>It seems when a decimal is added it returns false. How do you properly check for positive strings <code>&gt; +0.XX</code> and negative <code>&lt; -0.XX</code>  which 2 decimals..</p>
  
  <p>Thanks!</p>