小智 9
<?php
$christmas = "12-25";
$todays_date = date("m-d");
if($todays_date == $christmas) {
// Load a different stylesheet
} else {
// Load the stylesheet for the rest of the yeat
}
?>
Run Code Online (Sandbox Code Playgroud)
这将在圣诞节每年加载不同的样式表.可以通过更改$christmas变量将其更改为任何其他日期.我想这就是你要找的......