3
4

1 回答 1

1

如果您通过简单地回显字符串来生成文件,则应将其创建为 xml,然后执行回显,您需要将编码添加到文件中。

$content = '<?xml version="1.0" encoding="UTF-8"?>'

您需要按照预期在 xml 中创建文件。
前任:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<Worksheet>
<Table>
<Row>
<Cell><Data>$content</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>

于 2013-06-28T19:03:45.063 回答