# NOOB Question - Convert While loop to image

**URL:** <https://forum.kirupa.com/t/noob-question-convert-while-loop-to-image/302447>\
**Category:** programming\
**Created:** [December 30, 2009, 11:27pm UTC](https://forum.kirupa.com/t/noob-question-convert-while-loop-to-image/302447 "2009-12-30T23:27:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andypandy86](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@andypandy86](https://forum.kirupa.com/u/andypandy86)\
**Post date:** [December 30, 2009, 11:27pm UTC](https://forum.kirupa.com/t/noob-question-convert-while-loop-to-image/302447/1 "2009-12-30T23:27:10Z")

</div>

I am fairly new to PHP and simply 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? :}
