php生成EXCEL的编码转换问题 看你是怎么生成的excel,如果是用\t这样生成的话,那不能解决编码问题建议是用xml来生成excel,编码用utf-8 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果用xml生成在Excel2000就会把所有数据挤到一行去 <?xml version="1.0" version="utf-8"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>Diana</Author> <LastAuthor>Diana</LastAuthor> <Created>2006-04-25T11:58:52Z</Created> <LastSaved>2006-04-25T13:10:20Z</LastSaved> <Version>11.5606</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>12495</WindowHeight> <WindowWidth>16035</WindowWidth> <WindowTopX>0</WindowTopX> <WindowTopY>105</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Center"/> <Borders/> <Font ss:FontName="宋体" x:CharSet="134" ss:Size="12"/> <Interior/> <NumberFormat/> <Protection/> </Style> <Style ss:ID="s21"> <Font ss:FontName="宋体" x:CharSet="134" ss:Size="18" ss:Bold="1"/> </Style> <Style ss:ID="s29"> <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> </Style> <Style ss:ID="s35"> <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> <NumberFormat ss:Format="@"/> </Style> </Styles> <Worksheet ss:Name="Sheet1"> <Table ss:ExpandedColumnCount="5" ss:ExpandedRowCount="21" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="17.25"> <Column ss:AutoFitWidth="0" ss:Width="36"/> <Column ss:AutoFitWidth="0" ss:Width="69"/> <Column ss:AutoFitWidth="0" ss:Width="78.75"/> <Row ss:Height="22.5"> <Cell ss:StyleID="s21"><Data ss:Type="String">员工信息表</Data></Cell> </Row> <Row ss:AutoFitHeight="0"/> <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s29"><Data ss:Type="String">序号</Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String">工号</Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String">姓名</Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String">性别</Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String">年龄</Data></Cell> </Row> <{* 在这里对要循环输出的数据使用 section 处理。*}> <{section name=list loop=$Emps}> <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s29"><Data ss:Type="Number"><{$smarty.section.customer.rownum}></Data></Cell> <Cell ss:StyleID="s35"><Data ss:Type="String"><{$Emps[list].id}></Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String"><{$Emps[list].name}></Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="String"><{$Emps[list].sexual}></Data></Cell> <Cell ss:StyleID="s29"><Data ss:Type="Number"><{$Emps[list].age}></Data></Cell> </Row> <{/section}> </Table> </Worksheet></Workbook> PHP,我想用正则表达式得到数组(@中肖,@尖,@地s_3法,@在有)这四个数组元素,不包含@空格。 如何用代码返回前两页?(非JS方法) 啥意思呀 关于两个表中字段相加的问题? php for循环问题救命 如何让IE只是一个信息框?? 怎样处理这样的多选啊? 看看那里错了,为什么不能够执行? iframe里面是其他网站,怎么提取或者控制里面的内容? 自建函数,php7报错求高手帮忙 找PHP+MYSQL熟练者或团队,有一个项目 求一个自动检查网站断链的软件
在Excel2000就会把所有数据挤到一行去
<?xml version="1.0" version="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Diana</Author>
<LastAuthor>Diana</LastAuthor>
<Created>2006-04-25T11:58:52Z</Created>
<LastSaved>2006-04-25T13:10:20Z</LastSaved>
<Version>11.5606</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>12495</WindowHeight>
<WindowWidth>16035</WindowWidth>
<WindowTopX>0</WindowTopX>
<WindowTopY>105</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Center"/>
<Borders/>
<Font ss:FontName="宋体" x:CharSet="134" ss:Size="12"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<Font ss:FontName="宋体" x:CharSet="134" ss:Size="18" ss:Bold="1"/>
</Style>
<Style ss:ID="s29">
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
</Style>
<Style ss:ID="s35">
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<NumberFormat ss:Format="@"/>
</Style>
</Styles>
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="5" ss:ExpandedRowCount="21" x:FullColumns="1"
x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="17.25">
<Column ss:AutoFitWidth="0" ss:Width="36"/>
<Column ss:AutoFitWidth="0" ss:Width="69"/>
<Column ss:AutoFitWidth="0" ss:Width="78.75"/>
<Row ss:Height="22.5">
<Cell ss:StyleID="s21"><Data ss:Type="String">员工信息表</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0"/>
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s29"><Data ss:Type="String">序号</Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String">工号</Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String">姓名</Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String">性别</Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String">年龄</Data></Cell>
</Row> <{* 在这里对要循环输出的数据使用 section 处理。*}>
<{section name=list loop=$Emps}>
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s29"><Data ss:Type="Number"><{$smarty.section.customer.rownum}></Data></Cell>
<Cell ss:StyleID="s35"><Data ss:Type="String"><{$Emps[list].id}></Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String"><{$Emps[list].name}></Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="String"><{$Emps[list].sexual}></Data></Cell>
<Cell ss:StyleID="s29"><Data ss:Type="Number"><{$Emps[list].age}></Data></Cell>
</Row>
<{/section}> </Table>
</Worksheet>
</Workbook>