首页 > 代码库 > PHP 导入EXCEL文件

PHP 导入EXCEL文件

$filename = ‘hehe.xls‘;
header (‘Content-type: text/html; charset=UTF-8‘);
header ( "Content-type:application/vnd.ms-excel; charset=UTF-8");
header ( "Content-Type: application/download" );
header ( "Content-Disposition:filename=$filename" );

echo "一\t";
echo "\n";

$result[‘province‘] = ‘嘿嘿1‘;
$result[‘city‘] = ‘嘿嘿2‘;
$result[‘postcode‘] = ‘嘿嘿3‘;

foreach($result as $k=>$v){
    echo "$v\t\n";
}