Last active
May 17, 2024 04:29
-
-
Save dubbs/4459964 to your computer and use it in GitHub Desktop.
versioning filenames with last modified time - PHP
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 | |
function autoVer($url) { | |
$path = pathinfo($url); | |
$ver = '.' . filemtime($_SERVER['DOCUMENT_ROOT'] . $url) . '.'; | |
echo $path['dirname'] . '/' . str_replace('.', $ver, $path['basename']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment