一起学习网 一起学习网


PHP clearstatcache()函数详解

网络编程 PHP clearstatcache()函数详解 06-21
定义和用法
clearstatcache()函数的作用是:清除文件状态缓存。
PHP的缓存数据对更快更好的运行函数是非常有利的。如果一个文件在脚本中测试了多次,你也许会禁止对正确的结果进行缓存。为了实现这点,你可以使用clearstatcache()函数。
语法
clearstatcache()
提示和注意
提示:执行缓存的函数:
stat()
lstat()
file_exists()
is_writable()
is_readable()
is_executable()
is_file()
is_dir()
is_link()
filectime()
fileatime()
filemtime()
fileinode()
filegroup()
fileowner()
filesize()
filetype()
fileperms()
案例

<?php
//check filesize
echo filesize("test.txt");
echo "<br />";
$file = fopen("test.txt", "a+");
// truncate file
ftruncate($file,100);
fclose($file);//Clear cache and check filesize againcle
arstatcache();
echo filesize("test.txt");
?>

上述代码将输出下面的结果:
792100

一步一步学习PHP(7) php 字符串相关应用
1.字符串的表现形式在PHP中,字符串有三种表现形式:单引号,双引号,以及heredoc。PHP手册建议,在一般情况下,尽量使用单引号的字符串。如果需要

一步一步学习PHP(8) php 数组
1.PHP中的数组与其把PHP中的数组理解为我们狭义上的数组,我觉得还不妨把这个数组一分为二,一者为我们常规上的数组,一者为我们的Dictionary。2.创建

PHP5与MySQL数据库操作常用代码 收集
1建立数据库表:createdatabaseclub;createtablemember(idint(11)notnullauto_increment,novarchar(5)notnull,namevarchar(10)notnull,ageint(2)notnull,levelvarchar(10)notnull,sextinyint(1)notnull,dated


编辑:一起学习网

标签:数组,字符串,缓存,函数,表现形式