php生成word最簡單的例子
- php語言
- 關注:7.2K次
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="">';
}
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);
}
}
?>
- 文章版權屬於文章作者所有,轉載請註明 https://xuezhezhai.com/zh-hk/jsj/php/lwz5z6.html