php - Display Star Rating without voting -
i little stuck.
i have mysql database items. each item has corresponding rating (0-5).
now, when display list of items, want convert rating in stars. may not clickable.
but how can display rating stars each rating?
like:
item[1] rating: 4 => display 4 stars item[2] rating: 2 => display 2 stars item[3] rating: 1 => display 1 star , on
i calling existing rating this:
php echo $item['item']['rating']
print str_repeat('*', $item['item']['rating']);
Comments
Post a Comment