欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php 生成Tab鍵或逗號(hào)分隔的CSV

 更新時(shí)間:2016年09月24日 15:13:33   投稿:mrr  
這篇文章主要介紹了php 生成Tab鍵或逗號(hào)分隔的CSV的相關(guān)資料,代碼簡(jiǎn)單易懂,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

php 生成Tab鍵或逗號(hào)分隔的CSV的代碼如下所示:

<?php
header("Content-type:text/csv;charset=utf-8");
header("Content-Disposition:attachment;filename=aa.csv");
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
$data = "\xEF\xBB\xBFaaaaa\tbbbbb\tccccc\n11111\t222222\t33333"; // \xEF\xBB\xBF是bom頭
$data = iconv('utf-8', 'ucs-2', $data);
echo $data;
<?php
header("Content-type:text/csv;charset=utf-8");
header("Content-Disposition:attachment;filename=aa.csv");
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
$data = "aaaaa,bbbbb,ccccc\n11111,222222,33333";
$data = iconv('utf-8', 'gbk', $data);
echo $data;

以上所述是小編給大家介紹的php 生成Tab鍵或逗號(hào)分隔的CSV,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論