The simplest example of php generating word

WBOY
Release: 2016-07-25 09:04:01
Original
1392 people have browsed it
  1. class word
  2. {
  3. function start()
  4. {
  5. ob_start();
  6. print' xmlns:w="urn:schemas-microsoft-com:office:word"
  7. xmlns="http://www.w3.org/TR/REC-html40">';
  8. }
  9. function save($path)
  10. {
  11. print "";
  12. $data = ob_get_contents();
  13. ob_end_clean();
  14. $this->wirtefile ($path,$data);
  15. }
  16. function wirtefile ($fn,$ data)
  17. {
  18. $fp=fopen($fn,"wb");
  19. fwrite($fp,$data);
  20. fclose($fp);
  21. }
  22. }
  23. ?>
Copy code
Editor’s recommendation: Example code for php exporting word format documents The easiest way to generate excel or word documents with php php generates word document (read database) Example of php using phpword to generate word document Simple example of generating word file with php php generates code to export word (can include pictures) Example of php generating word php uses phpword to generate word documents


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template