本文实例讲述了php使用指定编码导出mysql数据到csv文件的方法。分享给大家供大家参考。具体实现方法如下:
<?php
/*
* PHP code to export MySQL data to CSV
*
* Sends the result of a MySQL query as a CSV file for download
* Easy to convert to UTF-8.
*/
/*
* establish database connection
*/
$conn = mysql_connect('localhost', 'login', 'pass') o