title: Best star rating solution for PHP
body: <p>I'm wondering what the best and most efficient way to write up the following PHP code would be?</p>
  
  <pre><code>    if ($av == 1) echo '/images/1-star.png';
      if ($av &gt; 1 &amp;&amp; &lt; 2) echo '/images/1-half-star.png';
      if ($av == 2) echo '/images/2-star.png';
      if ($av &gt; 2 &amp;&amp; &lt; 3) echo '/images/2-half-star.png';
  </code></pre>
  
  <p>Following this same pattern up to 5 stars.</p>