What is the purpose of using PHP to reference a CSS file in this context?

When using PHP to reference a CSS file, it allows for dynamic linking of the CSS file based on certain conditions or variables. This can be useful for applying different styles to a webpage based on user input, session data, or any other dynamic content.

<?php
$theme = "dark"; // Example variable determining the theme

echo '<link rel="stylesheet" type="text/css" href="styles/' . $theme . '.css">';
?>