title: Color depending on value
body: <p>I use this code multiple times in my script. Is there a way to shorten this code? Thank you in advance.</p>
  <pre><code>if ($aUurverschil &lt; 0){$avroegerkleur = &quot;red&quot;;} 
  if ($aUurverschil &gt; 0){$avroegerkleur = &quot;green&quot;;}
  if ($aUurverschil == 0){$avroegerkleur = &quot;#48f442&quot;;}
  
  if ($bUurverschil &lt; 0){$bvroegerkleur = &quot;red&quot;;} 
  if ($bUurverschil &gt; 0){$bvroegerkleur = &quot;green&quot;;}
  if ($bUurverschil == 0){$bvroegerkleur = &quot;#48f442&quot;;}
  </code></pre>
  <p>etc etc.</p>
  <p>I use them in a div:</p>
  <pre><code>&lt;div style=&quot;display:inline;color:&lt;? echo $avroegerkleur;?&gt;;&quot;&gt;
  </code></pre>