lastModified.func.php文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了lastModified.func.php文件相关的知识,希望对你有一定的参考价值。

With this snippet you will have the ability to deliver the most recent version of any file.

When dealing with a browser's cache you can't be certain your viewers are getting the most recent copy. By appending a GET value (the UNIX timestamp) to, for example, a stylesheet, you can make the browser think the stylesheet is dynamic, thus reloading the stylesheet time the modification date changes.
  1. <?php
  2. /**
  3.  * lastModified
  4.  *
  5.  * @author demon.devin
  6.  * @link PortableAppz.cu.cc/
  7.  * @copyright 2016
  8.  * @package lastMofified
  9.  * @version 1.0
  10.  *
  11.  * With this snippet you will have the ability to deliver the most recent version of any file.
  12.  * When dealing with a browser's cache you can't be certain your viewers are getting the most
  13.  * recent copy. By appending a GET value (the UNIX timestamp) to, for example, a stylesheet,
  14.  * you can make the browser think the stylesheet is dynamic, thus reloading the stylesheet time
  15.  * the modification date changes.
  16.  *
  17.  * PARAMETERS
  18.  * $filepath string path to the file of the document you wish to use
  19.  *
  20.  * EXAMPLE:
  21.  * <link rel="stylesheet" type="text/css" href="<?php echo lastModified('../css/style.css'); ?>" />
  22.  *
  23.  * OUTPUT:
  24.  * <link rel="stylesheet" type="text/css" href="style.css?1477050530" />
  25.  */
  26.  
  27. //
  28. //default settings
  29. if (!function_exists(lastModified)){
  30. function lastModified($filepath) {
  31. $lastModified = filemtime($path.$file);
  32. $timeStamp = $filepath.'?'.$lastModified;
  33.  
  34. return $timeStamp;
  35. }
  36. }
  37.  
  38. ?>

以上是关于lastModified.func.php文件的主要内容,如果未能解决你的问题,请参考以下文章

PHP文件上传设置文件类型代码?

PHP文件上传代码用法

C#使用HTML文件中的file文件上传,用C#代码接收上传文件

删除文件夹里面5个代码

目标代码文件可执行文件和库

目标代码文件可执行文件和库