file_put_contents():向文件中写入内容
1、新建php文件
2、声明要写入内容的文件
3、file_put_contents():向文件中写入内容
4、原文件的内容
5、刷新页面文件的内容变为写入的内容
6、file_put_contents():再次向文件中写入内容
7、刷新页面文件的内容变为刚写入的内容,由此可见之后的内容覆盖之前写入发内容附上源码<?phpheader('content-type:text/html;charset=utf-8');//file_put_contents():向文件中写入内容$filename='./2.txt';file_put_contents($filename,'this is a tree');file_put_contents($filename,'bbbbbbbbbbbb');
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:76
阅读量:61
阅读量:46
阅读量:95
阅读量:22