Home > Backend Development > PHP Tutorial > PHP如何判断文件是否被修改过

PHP如何判断文件是否被修改过

WBOY
Release: 2016-06-13 11:56:02
Original
1354 people have browsed it

PHP怎么判断文件是否被修改过
我在做缓存机制  客户端请求服务端数据 如果服务端的文件没更新就不发给客户端了
------解决方案--------------------
一种是filemtime()比较文件修改时间,另一种是filesize(),比较文件大小。
不过比较好的做法是“客户端请求服务端”的脚本里,添加一个数据库事务?你是怎么做文件修改的呢?
$_GET? $_POST?
file_put_contents()?fwrite()?
那么在这段代码后,将当前时间保存进数据库。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template