I’m wondering what the best and most efficient way to write up the following PHP code would be?
if ($av == 1) echo '/images/1-star.png';
if ($av > 1 && < 2) echo '/images/1-half-star.png';
if ($av == 2) echo '/images/2-star.png';
if ($av > 2 && < 3) echo '/images/2-half-star.png';
Following this same pattern up to 5 stars.
Just use like this:
Cut images per line and name it “1-star.png”, “1.5-star.png”, “2-star.png”, “2.5-star.png”, “3-start.png”, “3.5-star.png” and so on…