$filename=date("Y年m月d日")."データ統計結果.xls" //ファイル名
$ua = $; _SERVER[" HTTP_USER_AGENT"]; //中国語のファイル名は文字化けしません
if (preg_match("/MSIE/", $ua)) {
$filename=urlencode($filename);
} else if (preg_match("/ Firefox/", $ua)) {
$filename=$filename;
} else {
$filename=urlencode($filename);
}
header("Content-type:application/vnd.ms-excel"); //Excel ヘッダーを出力
header("Content-Disposition:filename=".$filename);
$n = iconv('utf-8', 'gbk', '11') //Excel テーブルの列を設定
$ t = iconv('utf-8', 'gbk', '22');
$k = iconv('utf-8', 'gbk', '33'); ', 'gbk ', '44');
$r= iconv('utf-8', 'gbk', '55');
$a= iconv('utf-8', 'gbk', '66 ');
echo "{$n}t";
echo "{$t}t";
echo "{$k}t";
echo "{$s}t";
echo "{$r}t";
エコー「{$a}tn」;
foreach($a as $kk=>$pp){ //列ごとに、いくつかのデータ
foreach($pp['child'] as $k=>$p){
echo iconv("utf - 8", "gbk//IGNORE", $pp['u']."t");
echo iconv("utf-8", "gbk//IGNORE", $p['u']." t ");
echo iconv("utf-8", "gbk//IGNORE", $p['s']."t");
echo iconv("utf-8", "gbk//IGNORE" , $p['t']."t");
echo iconv("utf-8", "gbk//IGNORE", $p['c']."t");
echo iconv("utf - 8", "gbk//IGNORE", $p['t']."tn");
}
}