发表时间:2015-05-27来源:网络
一、文件权限
二、写入文件
【例子】:
// Identify the file to use:
$file ='../quotes.txt';
// Check for a form submission:
if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle theform.
Your quotation has beenstored.
';
Yourquotation could not be stored due to a systemerror.
';
} // End of submitted IF.
// Leave PHP and display the form:
?>
三、锁定文件
四、读取文件
第一种方法:$data=file_get_contents($file);
第二种方法:$data=file($file);
【例】:
// Count the number of items in the array:
$n = count($data);
// Pick a random item:
$rand = rand(0, ($n -1));
// Print the quotation:
print '
' .trim($data[$rand]) .'
';
?>
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
PHP中的(++i)前缀自增 和 (i++)后缀自增
将视频设置为Android手机开机动画的教程
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2022-03-21
2014-09-05