Skip to content

Instantly share code, notes, and snippets.

@yuya-matsushima
Created November 11, 2011 09:04
Show Gist options
  • Save yuya-matsushima/1357551 to your computer and use it in GitHub Desktop.
Save yuya-matsushima/1357551 to your computer and use it in GitHub Desktop.
file_suffix.php
<?php
if ( ! function_exists('file_suffix'))
{
function file_suffix($file, $format='Ymdhis')
{
$CI = get_instance();
$file_path = FCPATH . ltrim($file, '/');
if (file_exists($file_path)) {
return $CI->config->base_url($file) . '?' . date($format, filemtime($file_path));
}
else
{
return $CI->config->base_url($file);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment