Home  >  Article  >  Backend Development  >  【PHPWord】从模板创办Word

【PHPWord】从模板创办Word

WBOY
WBOYOriginal
2016-06-13 11:33:041111browse

【PHPWord】从模板创建Word

源文件

生成


require_once 'PHPWord.php';$PHPWord = new PHPWord();$document = $PHPWord->loadTemplate('Template.docx');$document->setValue('Value1','Sun');$document->setValue('Value2','SNK');$document->setValue('Value3','MArs');$document->setValue('Value4','Earth');$document->setValue('Value5','Uranus');$document->setValue('Value6','Pluto');$document->setValue('Value7','Neptun');$document->setValue('Value8','Mercury');$document->setValue('Value9','Jupiter');$document->setValue('Value10','Plutos');$document->setValue('weekday',date('1'));$document->setValue('time',date('H:i'));<span style="color:#ff0000;">//保存文件$document->save('FromTemplate.docx');</span>


Statement:
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