$rating = number_format( $imgrating, 2 );
$ratingicon = "";
for ( $x=0; $x < round($rating); $x++ ) {
$ratingicon .= "<img src=\"rating.gif\">";
I'm assuming that $x++ lists $ratingicon however many times. What I want to do is set this up so that each value of $x displays a different image. For example, $x=1 changes the $ratingicon to <img src=\"rating_1.gif\"> and $x=2 changes the $ratingicon to <img src=\"rating_2.gif\">. Oh, and below is the else bit.
else {
$rating = ['nothing'];