- 论坛徽章:
- 2
|
PHP
生成word文档的
代码
,这个是用来生产试卷的简单PHP代码
试卷生成
difficulty."
";
$cout.=" ".$row->content."
";
}//while
?>
';
}
function save($path)
{
print "";
$data = ob_get_contents();
ob_end_clean();
$this->wirtefile ($path,$data);
}
function wirtefile ($fn,$data)
{
$fp=fopen($fn,"wb");
fwrite($fp,$data);
fclose($fp);
}
}
/*-------word class End-------*/
$word=new word;
$word->start();
echo $cout;
$wordname="word/".time().".doc";
$word->save($wordname);//保存word并且结束.
?>
" target=_blank class="unnamed1">试卷已经生成,请点击这里查看
您输入的条件不足,请重新输入!
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_547984.html |
|