- str_repeat: documentation ( source)
- floor: documentation ( source)
- htmlentities: documentation ( source)
- arsort: documentation ( source)
- fmod: documentation ( source)
<?php
$stars = array('Tom' => 0.9, 'Dan' => 0.8, 'Max' => 0.1);
arsort($stars);
foreach ($stars as $name => $stars) {
?>
<div style="font-size: 26pt;"><span style="width: 150px;"><?php echo htmlentities($name); ?></span>
<?php
echo str_repeat('<img style="height:30px;" src="http://ratherthecouch.files.wordpress.com/2013/02/gold-star.jpg?w=750" />', floor($stars / 5));
echo str_repeat('<img style="height:30px;" src="https://pbs.twimg.com/profile_images/446819911349043200/Q4Xvo_p5.jpeg" />', floor($stars % 5));
echo str_repeat('<img style="height:30px;" src="http://www.stalkingtools.com/img/logo.png" />', ( fmod($stars, 1) * 10));
?>
</div>
<?php
}