cant figur how to find a greater or less than for a variable
<p>I have tried muiltiple strings of code to find the awswer please help me out, here's the code</p>

<pre><code>    $rating = $row['rating_total'] / $row['number_ratings'];

if($rating &lt; 2 &amp;&amp; $rating =&gt; 1) {
$rating = ' &lt;img src="rating.png" /&gt; ';
  }

if($rating &lt; 3 &amp;&amp; $rating =&gt; 2) {
$rating = ' &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; ';
  }

if($rating &lt; 4) &amp;&amp; ($rating =&gt; 3) {
$rating = ' &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt;'; 
  } 
  if($rating &lt; 5) &amp;&amp; ($rating =&gt; 4) {
$rating = ' &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt;';
  }
   if($rating &lt; 6) &amp;&amp; ($rating =&gt; 5) {
$rating = ' &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; &lt;img src="rating.png" /&gt; ';
  }
</code></pre>
