一、文件权限
二、写入文件
立即学习“PHP免费学习笔记(深入)”;
【例子】:
// Identify the file to use:
$file ='../quotes.txt';
// Check for a form submission:
if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle theform.
Your quotation has beenstored.
';
采用JSP开发的办公自动化产品、基于B/S结构,运行环境:JDK v1.5、Tomcat v5.5、MySQL v4.1,三者均为以上版本其他相关内容:可视化流程设计: 流程支持串签、会签和分支流程,可以设置流程节点的修改、删除权限,并可指定流程中各个用户在表单中可以填写的域。智能表单所见即所得设计: 智能设计,自动在数据库中生成表格,方便优化程序 公共交流: 集论坛、博客、聊天室于一体文件柜:C
0
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]) .'
';
?>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号