pzg's blog

PHP生成word文档类

<?php
class word
{
function start()
{
ob_start();
print'<html xmlns:o=”urn:schemas-microsoft-com:office:office”
xmlns:w=”urn:schemas-microsoft-com:office:word”
xmlns=”http://www.w3.org/TR/REC-html40″>’;
}
function save($path)
{
print “</html>”;
$data = ob_get_contents();
ob_end_clean();
$this->wirtefile ($path,$data);
}
function wirtefile ($fn,$data)
{
$fp=fopen($fn,”wb”);
fwrite($fp,$data);
fclose($fp);
}
}
?>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注