Home > Backend Development > PHP Tutorial > php将数组写入文件

php将数组写入文件

WBOY
Release: 2016-06-23 13:45:31
Original
1018 people have browsed it

$str = '<?php return '."\n".var_export($data,true).';?>';$filename = 文件所在路径;$fp=fopen("$filename", "w+"); //打开文件指针,创建文件if(!is_writable($filename)){      die("文件:" .$filename. "不可写,请检查!");}file_put_contents($filename,$str);
Copy after login

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