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'] 

str_repeat():

print str_repeat('*', $item['item']['rating']); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -