Guest User

Untitled

a guest
Aug 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. if ( ! function_exists('file_suffix'))
  4. {
  5. function file_suffix($file, $format='Ymdhis')
  6. {
  7. $CI = get_instance();
  8.  
  9. $file_path = FCPATH . ltrim($file, '/');
  10. if (file_exists($file_path)) {
  11. return $CI->config->base_url($file) . '?' . date($format, filemtime($file_path));
  12. }
  13. else
  14. {
  15. return $CI->config->base_url($file);
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment