Skip to content

Instantly share code, notes, and snippets.

@MaraScott
Created March 20, 2013 03:51
Show Gist options
  • Select an option

  • Save MaraScott/5202180 to your computer and use it in GitHub Desktop.

Select an option

Save MaraScott/5202180 to your computer and use it in GitHub Desktop.
Name : getLastModification() - Language : PHP - type : function - Platform : generic - tag : timestamp, version, images
<?php
// put a timestamp after images as a variable to be sure to update the cache on the client side
// see : http://php.net/manual/en/function.filemtime.php
function getLastModification ($filename = __FILE__) {
if (file_exists($filename)) {
return filemtime($filename);
} else {
return '404';
}
}
// alias
function _glm ($f) {
getLastModification($f);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment