title: Detecting negative numbers
body: <p>I was wondering if there is any way to detect if a number is negative in PHP?</p>
  
  <p>I have the following code:</p>
  
  <pre class="lang-php prettyprint-override"><code>$profitloss = $result-&gt;date_sold_price - $result-&gt;date_bought_price;
  </code></pre>
  
  <p>I need to find out if <code>$profitloss</code> is negative and if it is, I need to echo out that it is.</p>