PHP导出CSV文件

  • 黄楚恒
  • 2017-08-28 14:21:35
  • PHP
  • CSV
<?php
//注意导出csv文件之前不能输出任何数据,否则失败
header('content-type:text/html;charset=utf-8');
//1.数据库取出数据  
$conn=mysql_connect('localhost','root','root');  
mysql_select_db('blog');
mysql_set_charset('utf8');
$result=mysql_query('select * from blog_user');  
$emps=array();  
while($row=mysql_fetch_assoc($result)){  
    static $i=0;  
    $emps[$i] = $row;  
    $i++;  
}  

//设置内存占...
		                        
  • 共 1 条记录

Copyright © 2016-2019 709173702@qq.com 版权所有  ICP证粤ICP备16117826号-1
联系邮箱:709173702@qq.com