02 |
require_once ( dirname (__FILE__) . "/../include/common.inc.php" ); |
03 |
$output = fopen( '' , 'w' ) or die( "can't open " ); |
04 |
header( 'Content-Type: application/csv' ); |
05 |
header( 'Content-Disposition: attachment; filename="认证列表.csv"' ); |
07 |
iconv( 'utf-8' , 'gb2312' , '姓名' ), |
08 |
iconv( 'utf-8' , 'gb2312' , '电话' )//文件表头 |
10 |
fputcsv($output, $arrkeys); |
12 |
$sql = "SELECT * FROM dede_test" ; |
13 |
$dsql->Execute( 'me' ,$sql); |
14 |
while ($row = $dsql->GetArray( 'me' )){ |
16 |
$mobile= $row[ 'mobile' ]; //循环 |
19 |
iconv( 'utf-8' , 'gb2312' ,$name), |
20 |
iconv( 'utf-8' , 'gb2312' ,$mobile) |
22 |
fputcsv($output, $arrkeys); |
25 |
fclose($output) or die( "can't close " ); |
|