Home > Backend Development > PHP Tutorial > 怎么用PHP实现数据库导出到txt文件或csv文件

怎么用PHP实现数据库导出到txt文件或csv文件

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:07:24
Original
1055 people have browsed it

如何用PHP实现数据库导出到txt文件或csv文件
rt

------解决方案--------------------
while($r=mysql_fetch_assoc($rs)) {
file_put_contents('文件名', '"' . join('","', $r) . '"' .PHP_EOL, FILE_APPEND);
}

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