首页 > PHP导出excel,\t无法分割单元格,而是显示一段空格

PHP导出excel,\t无法分割单元格,而是显示一段空格

    $name='down';
    header( "Cache-Control: public" );
    header( "Pragma: public" );
    header("Content-type:application/vnd.ms-excel");
    header("Content-Disposition:attachment;filename=".$name.".xlsx");
    header('Content-Type:APPLICATION/OCTET-STREAM');

    echo “ID”.“\t”;
    echo “username”.“\t”;

这样输出后,ID跟username还是在一个单元格里,只是中间空了一段空格。
\n 可以换行

【热门文章】
【热门文章】