Jump to content

Convert While loop number to images


wispas

Recommended Posts

i want to create a star system for my site.

 

what i am doing is creating a variable with a number and want it to output a number of stars based on my variable. can this be achieved.

 

not sure if i am on right steps, but i currently have a while loop set up

 

<?php

 

$starter = 0;

$empty = 5;

// echo $empty;

 

while ($starter < $empty){

 

$starter = $starter + 1;

echo $starter;

 

}

 

?>

 

this gives me the following:

12345

 

instead of numbers i want it to loop the same image and output stars based on my $empty variable. is this possible?

Link to comment
https://forums.phpfreaks.com/topic/186752-convert-while-loop-number-to-images/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.