In PHP, what are the benefits of using function parameters to enhance flexibility and decision-making in icon display scripts?

Using function parameters in icon display scripts allows for greater flexibility and decision-making by allowing the caller of the function to customize the icon display based on their specific needs. By passing parameters to the function, you can dynamically change the icon type, size, color, and other attributes without having to modify the function itself.

function displayIcon($iconType, $iconSize, $iconColor) {
    echo "<i class='icon-$iconType' style='font-size: $iconSize; color: $iconColor;'></i>";
}

// Example usage
displayIcon('star', '20px', 'yellow');