How can PHP variables be utilized in CSS stylesheets?
PHP variables can be utilized in CSS stylesheets by embedding PHP code within the stylesheet file and using PHP echo statements to output the values of the variables. This allows for dynamic styling based on PHP variables, such as changing colors, font sizes, or other style properties based on conditions or user input.
<?php
header("Content-type: text/css");
$color = "#FF0000";
$font_size = "16px";
?>
body {
background-color: <?php echo $color; ?>;
font-size: <?php echo $font_size; ?>;
}