rating); // Number of filled stars
$has_half = ($comment->rating - $filled_stars) > 0; // Check if there's a decimal part
for ($i = 1; $i <= 5; $i++) {
echo "
";
if ($i <= $filled_stars) {
echo "";
} elseif ($has_half && $i == $filled_stars + 1) {
echo "";
} else {
echo "";
}
echo "
";
}
?>