Well I'm creating a simple rating system. What I intend is that every 2 ratings it adds a Star, with a maximum of 5 stars.
How do I do this? I've been doing this more, no geito ..
$star = "<li><a href='#'><i class='fa fa-star' aria-hidden='true'></i></a></li>";
$max_stars = 5;
$total_stars = $product_review / $max_stars * 1;
for($i=1;$i<=5;$i++) {
if($product_review >= $i) {
if($total_stars) {
echo $star;
}
}
}
And so, I created this but ... I'm 100% confused .. because it does exactly that, so add 1 star to every 1 review ... Did I make the code right?