Need ctype_digit to return true for negative numbers also
<p>I need to take a string and return true if only positive OR negative numbers are in the string. Is there a way to do this? </p>

<pre><code>$rating = "-25";
if (!ctype_digit($rating)) {
echo "Not a digit.";
} 
else {
echo "Is a digit.";
} 
</code></pre>

<p><b> Result: </b></p>

<p>Not a digit.</p>

<p><b> Need Result: </b></p>

<p>Is a digit.</p>