Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.