Created
November 4, 2018 07:04
-
-
Save sueharaluke/06518e8f538ff5933e3a2fb323df2db3 to your computer and use it in GitHub Desktop.
Add timestamp to css/js after update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cssfile = '/styles.css' | |
?> | |
<link rel="stylesheet" href="<?php echo $cssfile.'?v='.filemtime($_SERVER['DOCUMENT_ROOT'].$cssfile);?>" /> | |
<!-- | |
If you prefer a full date | |
--> | |
<link rel="stylesheet" href="<?php echo $cssfile.'?v='.date'Ymd', filemtime($_SERVER['DOCUMENT_ROOT'].$cssfile));?>" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment